WEB开发网
开发学院网页设计JavaScript Prototype实战教程----10.Element 阅读

Prototype实战教程----10.Element

 2010-09-14 13:10:15 来源:WEB开发网   
核心提示:<html><head><script src="prototype.js"></script><script> function testRemove(){Element.remove("mydiv3");}funct

<html><head><script src="prototype.js"></script>
  <script> 
      function testRemove()
     {
       Element.remove("mydiv3");
       }
       function testReplace()
       {
         Element.replace("myDiv2",'<img src=http://tech.ddvip.com/2008-10/"200607061129268fc45.jpg">');
         }
         </script>
  </head>
  <body>
     <div id="myDiv">    2002  </div>
     <div id="myDiv1">    2003  </div>
     <div id="myDiv2">    2004  </div>
     <div id="myDiv3">    将被删除的部分  </div>
     <div id="myDiv4">    2006  </div>
     <div id="myDiv5">    2007  </div>
     <div id="myDiv6">    2008  </div>
     <hr>
       <input type="button" value='removeTest' onclick="return testRemove();"/><br>
         <input type="button" value='testReplace' onclick="return testReplace();"/><br>
     </body>
    
    
     </html>

Tags:Prototype 实战 教程

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接