编辑下面的代码:【加编码】
<html> <body> 主页: <input type="url" id="myURL" value="/"> <p>点击按钮修改 URL 字段的 URL 地址</p> <button onclick="myFunction()">点我</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myURL").value = "http://www.google.com"; } </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂