【www.gdgbn.com--jquery】
$("#div1 :text").each(function () {
var this_id = $(this).attr("id");
alert(this_id);
}
方法二
function $id(selector){
$(""+ selector +" :text").each(function () {
//coding
}
}$id("#div1"); //调用传参
方法三
$("#div1").arrt("id","div2");
html代码