span 标记的可编辑与不可编辑

 

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
  
 <HTML> 
 <HEAD> 
 <TITLE>Untitled</TITLE> 
 <LINK REL="stylesheet" HREF="samplesSDKIE4.css" TYPE="text/css"> 
 <SCRIPT type="text/javascript"> 
 function chgSpan() {  
 currentState = oSpan.isContentEditable;  
 newState = !currentState;  
 oSpan.contentEditable = newState;  
 oCurrentValue.innerText = newState;  
 newState==false ? oBtn.innerText="Enable Editing" :  
 oBtn.innerText="Disable Editing"  
 }  
 </SCRIPT>  
 </HEAD> 
 <!--TOOLBAR_START--> 
 <!--TOOLBAR_EXEMPT--> 
 <!--TOOLBAR_END--> 
 <BODY οnlοad="oCurrentValue.innerText = oSpan.isContentEditable;"> 
 <DIV class="body"> 
 <P>Click the button to enable or disable SPAN content editing.</P> 
 <P><BUTTON ID="oBtn" οnclick="chgSpan()">Enable Editing</BUTTON></P> 
 <P><SPAN ID="oSpan">You can edit this text.</SPAN></P> 
 <P>SPAN can be edited: <SPAN ID="oCurrentValue"></SPAN></P> 
  
  
 <!-- START_PAGE_FOOTER --> 
 <BR><BR><BR> 
 <p class="viewsource">[Right-click and choose View Source from the shortcut menu.] </p> 
 <A class="copyright" HREF="http://www.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm">© 2007

Microsoft Corporation. All rights reserved. Terms of use.</A> 
 <!-- END_PAGE_FOOTER --> 
 </DIV> 
 </BODY> 
 </HTML>

 

http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/contentEditableEX2.htm  
金老师,我刚刚发现的一个demo:可以设置特定的html标记的可编辑性。

http://msdn.microsoft.com/en-gb/library/ms537837(VS.85).aspx  

太不可思议了。 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值