编辑下面的代码:【加编码】
<html> <body> <p>这边引用了 WWF's 站点的内容:</p> <blockquote id="myBlockquote" cite="http://www.worldwildlife.org/who/index.html"> For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by 1.2 million members in the United States and close to 5 million globally. </blockquote> <p>Click the button below to change the value of the cite attribute of the quotation above.</p> <p id="demo"></p> <button onclick="myFunction()">点我</button> <script> function myFunction() { document.getElementById("myBlockquote").cite="http://www.cnn.com"; document.getElementById("demo").innerHTML="cite属性的值修改为 'www.cnn.com'."; } </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂