Javascript examples for DOM HTML Element:Input Text
Focus first textbox created using a FOR LOOP
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from ww w. j a v a2 s . c o m*/ function defaultFocus(name) { document.getElementsByName(name)[0].focus(); } defaultFocus('totalAmt'); } </script> </head> <body> <input type="text" id="totalAmt" name="totalAmt" size="10" value="0"> </body> </html>