[b]attr(attributeName) 或者attr(attributeName,value) [/b]
设置或返回第一个匹配元素的属性值
[url]http://www.css88.com/jqapi-1.9/attr/[/url]
[b]removeAttr(attributeName) [/b]
为匹配的元素集合中的每个元素中移除一个属性
---对应原生removeAttribute() 函数
[url]http://www.css88.com/jqapi-1.9/removeAttr/[/url]
设置或返回第一个匹配元素的属性值
<style>
em { color:blue; font-weight:bold; }
</style>
<p>a<em title="huge, gigantic">large</em> orange</p>
The title of the emphasis is:<div></div>
<script>
var title = $("em").attr("title");
$("div").text(title);//结果:The title of the emphasis is:huge, gigantic
</script>
$("em").attr({'title':'big','value':'me'});
$("div").text($("em").attr("title"));//结果:The title of the emphasis is:big
[url]http://www.css88.com/jqapi-1.9/attr/[/url]
[b]removeAttr(attributeName) [/b]
为匹配的元素集合中的每个元素中移除一个属性
---对应原生removeAttribute() 函数
$("em").removeAttr("title");
alert($("em").attr("title"));//undefined
[url]http://www.css88.com/jqapi-1.9/removeAttr/[/url]