L
linuxnooby
Hi
I want a form field to be selected when the page loads.
But I get the error message
Error: document.getElementById("ff") has no properties
any ideas what I am doing wrong?
code below
cheers Dave
<script type="text/javascript">
function setfocus()
{
document.getElementById('ff').focus();
}
window.onload = setfocus();
</script
<form>
<input type="text" id="ff" >
</form>
I want a form field to be selected when the page loads.
But I get the error message
Error: document.getElementById("ff") has no properties
any ideas what I am doing wrong?
code below
cheers Dave
<script type="text/javascript">
function setfocus()
{
document.getElementById('ff').focus();
}
window.onload = setfocus();
</script
<form>
<input type="text" id="ff" >
</form>