Why does this not work…
$(‘#parent’).children()[3].html(‘Content’);
Doesn’t work
TypeError: $(“#parent”).children()[3].html is not a function.
when this does?
var x = $(‘#parent’).children()[3].className;
Does work
An example is found at my now-mashed jsperf test
Thanks.
$("#parent").children()[3]gives you a native DOM object, not a jQuery object, andhtmlis not a property on DOM nodes, butclassNameis. Use.innerHTMLto get the inner HTML.Live Demo
or