我正在练习一些 jquery 函数,但我被困在这里,prepend 不适合我。谁能请为什么它不起作用?
HTML:
<html>
<head><title>BLAH</title></head>
<body>
<div id="waterwheel-carousel-default">
<a href="#" id="Up" class="UpLink">Up</a>
</div>
</body>
</html>
JavaScript:
var noofpagelinks = 2;
var count;
for (count = 0; count < noofpagelinks; count++) {
$(".waterwheel-carousel-default").prepend("<a href=# class=PageLink id=PageLink" + count + "/>" + count + "</a>");
}
JSFiddle:http: //jsfiddle.net/YGSS4/4/