JavaScript 参考手册
Style width 属性
设置按钮的宽度
源代码:
点击运行 »
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>蜜蜂教程(mifengjc.com)</title> <script> function displayResult() { document.getElementById("b1").style.width = "300px"; } </script> </head> <body> <input type="button" id="b1" onclick="displayResult()" value="修改按钮的宽度"> </body> </html>
运行结果:
点击运行 »