How to set the focus of HTML elements

Time:2019-11-6

Copy code

The code is as follows:

<body
<form action=”” method=”post” name=”form1″ >

<input type=”text” />

</form>

</body>

<script> function myfocus() { document.getElementById(‘id’).focus(); } </script>