prototype中Insertion测试

本文通过一个简单的HTML页面示例展示了如何使用Prototype JavaScript库进行元素的插入操作,包括在目标元素之前、之后、顶部和底部插入新内容。

来一起画一条大粗线,哈哈

 

 
 
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
  2. <html> 
  3.     <head> 
  4.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
  5.         <title>Untitled Document</title> 
  6.         <script src="prototype.js"> 
  7.         </script> 
  8.     </head> 
  9.     <body> 
  10.         <div id="insertionTest" style="font-size:20px;font-weight:bold"> 
  11.             <hr>Insertion<hr> 
  12.         </div> 
  13.         <script> 
  14.              
  15.             new Insertion.After("insertionTest", " After"); 
  16.             new Insertion.Bottom("insertionTest", " Bottom"); 
  17.             new Insertion.Top("insertionTest", " Top"); 
  18.             new Insertion.Before("insertionTest", " Before"); 
  19.         </script> 
  20.     </body> 
  21. </html> 

 


本文转自sucre03 51CTO博客,原文链接:http://blog.51cto.com/sucre/413359,如需转载请自行联系原作者


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值