编辑下面的代码:【加编码】
<html> <head> <script> function displayResult() { document.getElementById("b1").style.position="absolute"; document.getElementById("b1").style.top="100px"; document.getElementById("b1").style.left="100px"; } </script> </head> <body> <p>This is a paragraph.</p> <p>This is a paragraph.</p> <p>This is a paragraph.</p> <p>This is a paragraph.</p> <input type="button" id="b1" onclick="displayResult()" value="Position me"> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂