保定网站建设,网站推广,网站优化服务,保定专业的PHP网站制作机构!

jQuery 删除标签的属性removeAttr(name)

发表于:2009年02月10日 11时  作者:dx_andy

jQuery删除标签的属性:动态控制文本标签的可读性时用到此操作:

jQuery 删除标签的属性removeAttr(name)示例代码:

<script type=”text/javascript”>
jQuery(function(){
if (jQuery(‘#Radio1′).attr(‘checked’)) {
jQuery(‘#RadioTitle’).removeAttr(‘readonly’);
} else {
jQuery(‘#RadioTitle’).attr(‘readonly’, ‘readonly’);
}
jQuery(‘#Radio0′).focus(function(){
jQuery(‘#RadioTitle’).attr(‘readonly’, ‘readonly’);
});
jQuery(‘#Radio1′).focus(function(){
jQuery(‘#RadioTitle’).removeAttr(‘readonly’);
});
});
</script>

 订阅“PHPLAMP博客”方便及时获取网站内容

PHPLAMP博客是专注于网站建设,搜索引擎研究,网站推广,网站优化的IT博客。

有关, 的相关文章:

“jQuery 删除标签的属性removeAttr(name)” 共有2篇评论

  1. oil painting says:

    谢谢,学习了

发表一下您对本文的意见