jQuery中包裹后的DOM对象实际上是一个数组,要获得纯粹的DOM对象可以有两种方式: 1.使用数组索引方式访问,例如: var dom = $(dom)[0]; 如: $("#id")[0] 2.使用函数get()访问,例如: var dom = $(dom).get(0); get()函数中的参数为索引号. 什么是jQuery对象? 就是通过jQuery包装DOM对象后产生的对象.jQuery对象是jQuery独有的,其可以使用jQuery里的方法. 比如: $("#t
项目中用的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