3
rated 0 times
[
6]
[
3]
/ answers: 1 / hits: 24198
/ 12 Years ago, tue, october 16, 2012, 12:00:00
I am trying to add a class to a newly appended DIV without using something like:
t.y.append('<div class=lol'+i+'></div>');
Here's a better example of what I'm trying to do:
var t = this;
$(this.x).each(function(i, obj) {
//append new div and add class too <div></div>
t.y.append('<div></div>').addClass('lol'+i);
});
Page load HTML looks like:
<div class=.slideButton0 .slideButton1 .slideButton2 id=sliderNav>
<div></div>
<div></div>
<div></div>
</div>
More From » jquery