$("#parent").children()[3]给你javascript object not jQuery object和html没有在javascript中定义,但className存在于javascript中.用户] innerHTML获取html.Ø
Note: $("#parent").children()[3].html ,这里的html甚至没有在jQuery中定义你需要使用html()而不是像下面的例子中给出的那样,并使用eq来获取jQuery对象 $("#parent").children().eq(2).html()
alert($("#parent").children()[2].innerHTML);
Run Code Online (Sandbox Code Playgroud)
要么
alert( $("#parent").children().eq(2).html());
Run Code Online (Sandbox Code Playgroud)