Adding Text To Div Using Jquery
I am trying to add a line of text to a span tag, and although it seems like it should work something weird is happening, it is adding many lines of the text I inputted into the script. I want "On Sale For" to appear before the sale price span, so I am using the following.
<script>
$('.SalePrice').each(function() {
$(this).before($('<span>').prepend('On Sale For: '));
});
</script>
And it does add it, however there are about 10 more extra "on Sale for" ;s as well, how do I get it to just show one.
Please advise, Thanks in advance,
heykate