编辑您的代码:
查看结果:
<!DOCTYPE html> <html> <body> <input value="OK"> <p id="demo">点击按钮来设置按钮的 type 属性。</p> <button onclick="myFunction()">试一下</button> <script> function myFunction() { document.getElementsByTagName("INPUT")[0].setAttribute("type","button"); } </script> <p>Internet Explorer 8 以及更早的版本不支持此方法。</p> </body> </html>
查看结果:
系统帮助
|
给我留言
|
收藏本站
Copyright © 2005-2008
www.cnn84.com
All Rights Reserved Ver:2.0
桂公网安备45122402000102号
CNN84网是公益性便民网站,是为了给大家的日常生活查询及提供最快捷的出行指南
晚上好!CNN84祝你今晚玩的愉快!天天都有新收获!