選取器,選取標籤多屬性,如type&name
可用於選取姓別的radiobox
if(sex==1){
$(“input[name=’sex’][type=’radio’][value=’1′]”).attr(“checked”,true);
}else{
$(“input[name=’sex’][type=’radio’][value=’0′]”).attr(“checked”,true);
}
相關網址
http://stackoverflow.com/questions/3221094/target-input-by-type-and-name-selector