jQuery addClass to all Elements with Class
$('.specialprice.priceis').addClass('strike');
?
Your HTML is wrong
<span id="priceis">
You probably meant to set class
instead of id
.
<span class="priceis">
Your current code will work if you fix your HTML.
You might want to see this answer, it explains why a script doesn't work when included before the DOM elements.
maybe something like this? still not sure about the explanation of your question, not clear..
$(function() {
$('.specialprice').each(function() {
$(this).find('.priceis').addClass('strike');
});
}
EDIT: just realized maybe you wanted it like this?
$('.specialprice').each(function() {
$(this).find('*').addClass('strike');
});