<div id="id1" class="desc">Hello World 1</div>
<div id="id2" class="desc">Hello World 2</div>
<div>test</div>
在 document.ready 中,
$(function(){
var $dvObj = $('div.desc');
alert($dvObj[0]);
alert($dvObj[0].text()); //Nothing comes up
alert($dvObj[0].html()); //Nothing comes up
});
我无法获取 div html。请建议。