<html> <head> <title></title> <script> window.onload = function(){ div2.innerHTML = div1.innerHTML.replace(/ShowClass/g,"ShowWzClass"); } </script> </head> <body> 替换前: <div id="div1"> <xmp> <DIV id=ware_right_10> <div class="show_page">共 <b>300 </b> 个商品 首页 | 上一页 | <font color="FF0000">1 </font> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=2">2 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=3">3 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=4">4 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=5">5 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=6">6 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=7">7 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=8">8 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=9">9 </a> | <a href='/YLcn/Shop/ShowClass.asp?ClassID=1&page=2'>下一页 </a> | <a href='/YLcn/Shop/ShowClass.asp?ClassID=1&page=11'> 尾页 </a> <b>28 </b>个商品/页 转到第 <Input type='text' name='page' size='3' maxlength='5' value='1' onKeyPress="if (event.keyCode==13) window.location='/YLcn/Shop/ShowClass.asp?ClassID=1&page='+this.value;">页 </div> </DIV>> </xmp> </div> 替换后: <div id="div2"></div> </body> </html>
window.onload=function(){ document.all.ware_right_10.innerHTML=document.all.ware_right_10.innerHTML.replace(/ShowClass/gi,'ShowWzClass'); }