项目中用的jquery-1.10.2 需要检测一个checkbox的选中状态,想当然的用 .attr("checked") ,结果发现,无论是否选中,这个值都是 undefined 未定义. 查找资料,特此记录: jq官网说明: As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. In addition, .attr() should not be u
项目中用的jquery1.9 今天需要检测一个checkbox的选中状态,想当然的用 .attr("checked") ,结果发现,无论是否选中,这个值都是 undefined 未定义. 折腾了半天,无奈,只能取jq官网看看文档,发现有这么一段说明 As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set. In addition, .attr() shoul