This is my code so far:
$("h1.intro:contains('|')").each(function() {
$(this).html($(this).html().replace('|','</span><br /><span>'))
});
This works just once, but it has to work for all of those "|"...
any ideas?
Add /g
modifier:
$("h1.intro:contains('|')").each(function() {
$(this).html($(this).html().replace(/\|/g, '</span><br /><span>'));
});
More Info:
The g modifier is used to perform a global match (find all matches rather than stopping after the first match).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With