安科网
源代码:
点击运行
<!DOCTYPE html> <html> <body> <p>Click the button to replace "Microsoft" with "W3CSchool" in the paragraph below:</p> <p id="demo">Visit Microsoft!</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var str=document.getElementById("demo").innerHTML; var n=str.replace("Microsoft","W3CSchool"); document.getElementById("demo").innerHTML=n; } </script> </body> </html>
运行结果
Copyright © 2013 - 2019 Ancii.com All Rights Reserved
京ICP备18063983号-5
京公网安备11010802014868号