I have elements like this all over the page:
<span class="am-product-terms">$49.95 for each 3 months</span>
<span class="am-product-terms">$149.95 for each year</span>
I wanted to remove the the for... part all up to the end. So I did this:
$('.am-product-terms').replace(/for[\s\S]+/, '')
That threw an error so I tried this:
$('.am-product-terms').text().replace(/for[\s\S]+/, '')
This didn't work either.