时间:2021-07-01 10:21:17 帮助过:95人阅读
- <!DOCTYPE html>
- <html>
- <head>
- <script>
- function check(){
- listForm.sel.checked=true;
- }</script></head><body><form name="listForm">
- <input type="checkbox" name="sel"/></form><input type="button" value="button" onclick="check();"/>
- </body>
- </html>
按下button键会使得form表单里的名为sel的checkbox被选中.
以上就是利用html的name属性获取dom元素的详细内容,更多请关注Gxl网其它相关文章!