I am practising some jquery functions and I am stuck here with prepend not working for me. Could anyone please why is it not working?
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/
You should be using the ID selector, not class
Change
$(".waterwheel-carousel-default")to
$("#waterwheel-carousel-default")