我有一個變種,我想追加多次與jQuery。代碼是像這樣:追加多個變量與jquery
var number = 4; //number of times the html must be appended
html = $("<div>Content here</div>"); //The html I want to append
$(document).ready(function() {
$("body").append(html * number); //Append the div multiple times
});
我不知道我怎樣才能使HTML VAR附加在數VAR(4)中提到的次量?上面的代碼不起作用,我可以看到爲什麼。但我看不到解決這個問題的方法。有任何想法嗎? (我不是jQuery的專家!)
非常感謝,非常完美! –