2
The scenario is as follows: I dynamically assemble an html. After the html is generated it is +/- like this:
var templateHtml = "<div class='bola'>Bola 1</div><div class='bola'>Bola 2</div><div class='casa'>Casa 1</div>";
I would like to add the class "football" in all Divs with the class "ball".
I tried so:
templateHtml = $(templateHtml).find(".bola").addClass("futebol");
But it didn’t work....
That’s right! But why does filter return html and find no? I haven’t figured that out yet.
– Joao Paulo
@Joaopaulo I edited the answer. I hope it became clearer =)
– Oeslei