1.如何获取/设置某个元素的属性值
2.如何获取/设置某个元素多个属性值
3.如何通过匿名fn来设置某个元素的属性值
4.如何删除元素指定的属性
//获取属性值
/**
$(function(){
alert($("div").attr("id"));
})
*/
//设置属性值
/**
$(function(){
$("div").attr("title","属性值");
})
*/
//设置多个属性值
/**
$(function(){
$("div").attr({"title":"属性值","class":"cla","date":"2017"});
})
*/
//用function设置值
/**
$(function(){
$("div").attr("title",function(){
return "设置属性值";
})
})
*/
//用function设置带一个参数的值
/**
$(function(){
$("div").attr("title",function(index){
return "设置属性值"+index;
});
})
*/
// 用function设置带两个参数
/**
$(function(){
$("div").attr("title",function(index,value){
return "设置属性值"+index+value;
});
})
*/
//删除属性值
/**
$(function(){
$("div").removeAttr("title");
})
*/