日期:2014-05-16 浏览次数:20469 次
<div class="copyright"> <ul> <li><a href="ContactUs.htm" class="white">联系我们</a> <span>|</span></li> <li><a href="about.htm" class="white">关于我们</a> <span>|</span></li> <li><a href="Joinus.htm" class="white">加入我们</a> <span>|</span></li> <li><a href="ContactUs.htm" class="white">联系我们</a></li> </ul> <p class="white">替换掉这里</p> </div>
<script type="text/javascript"> document.getElementsByTagName('p').item(0).innerHTML = '你好'; </script>
------解决方案--------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script> function change() { var a = document.getElementById("white"); a.innerHTML = '你想替换成什么啊?!'; } </script> </head> <body> <div class="copyright"> <ul> <li><a href="ContactUs.htm" class="white">联系我们</a> <span>|</span></li> <li><a href="about.htm" class="white">关于我们</a> <span>|</span></li> <li><a href="Joinus.htm" class="white">加入我们</a> <span>|</span></li> <li><a href="ContactUs.htm" class="white">联系我们</a></li> </ul> <p id="white">替换掉这里</p> </div> <input type='button' value='change' id='aa' onclick="change()"/> </body> </html>