jquery + prepend text not working
- by Tiago Teixeira
Hello,
I have this following code:
$(".preview").find("#panel").each(function(i, val) {
var x = "" + $(val).html();
$(x).find(".dmPageHeadline").prepend(" 1 - ");
console.log($(x).html());
html += $(x).html();
});
This code iterates through all accordion panels, concatenates its content and add " 1 - " to the header ( class "dmPageHeadline" ).
Probably it's a simple detail, but i cannot figure it out... this line $(x).find(".dmPageHeadline").prepend(" 1 - "); doesn't preprend the desired text.
Anyone can point me out what is wrong here?
Thank you very much and happy new year !
Teixeira