为什么
the following code失败了:
错误:class_a_jquery_objects [0] .parent不是函数
?
HTML:
<div> <div class='a b'></div> <div class='b c'></div> <div class='c a'></div> </div> <div id='log'></div>
JS:
$(function() { var class_a_jquery_objects = $(".a"); $("#log").append(class_a_jquery_objects.length + "<br />"); $("#log").append(class_a_jquery_objects[0] + "<br />"); $("#log").append(class_a_jquery_objects[0].parent() + "<br />"); });