首页 > Web开发 > 详细

JS 移除一个属性

时间:2015-12-14 14:29:00      阅读:193      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE HTML PUBLIC  "-//W3C//DTD HTML 4.0//EN"   
"http://www.w3.org/TR/REC-html140/strict.dtd">  
<html>  
<head>  
    <meta http-equiv="content-type" content="text/html; charset=gb2312"/>  
    <title>Sample Page!</title>  
    <mce:script language="JavaScript" type="text/javascript"><!--  
   
function TestEvent()   
{   
  document.MyForm.text1.removeAttribute("disabled"); //移除disable属性.  
  document.MyForm.text1.value="enable";//改变文本框中的文字.  
}  
// --></mce:script>  
</head>  
<body>  
    <form name="MyForm" action="">  
    <input type="text" name="text1" value="disabled" disabled="disabled"/>  
    <input type="button" name="MyButton" value="MyTestButton" onclick="TestEvent()"/>  
    </form>  
</body>  
</html> 

 

JS 移除一个属性

原文:http://www.cnblogs.com/yjhua/p/5044985.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!