0
我有一個變量有幾個克隆項目。我試着將其打印出來,但我一直getitng「[對象HTMLDivElement]」而不是實際的HTML如何打印對象html
$.each(theGood, function() {
$('#work .slider').wrap(function(){
$('#work .slider').prepend('<div class="group">'+this+'</div>');
});
});
}
下面是我使用的代碼。我試着用theGood [i}做一個for循環,但沒有運氣
嘗試'$('#work .slider')。prepend('
如果'theGood'是一個選擇器,那麼'$ .each(theGood,function(el)'並且比使用'el'代替'this'或'el.html()'。當然,如果你想輸出' theGood' – Cheery 2014-10-08 04:25:54
而不是'this.innerHTML',如果你想打印html,你可以使用'$(「
」).text(this.innerHTML).html()'。 – 2014-10-08 04:36:27