Setting focus to an input Field when the PageLoads using JavaScript in HTML

Syedshakeer
Posted by Syedshakeer under CSS 3 category on | Views : 3280
Setting focus to an input Field when the PageLoads using JavaScript in HTML

<html>
<head runat="server">
<title>Untitled Page</title>
<script type ="text/javascript" >
function focusmethd()
{
document.getElementById("TextBox1").focus();
}
</script>
</head>
<body onload="focusmethd()")>
<form id="form1">
<input type="text" ID="TextBox1">
<input type="text" ID="TextBox2">

</form>
</body>
</html>

Comments or Responses

Login to post response