how to increase selection criteria??
I have this statement:
$(function() {
$('em:contains("$0.00")').each(function() {
$(this).html("Call for Shipping");
});
});
It's not specific enough, it won't work if it's $20.00 for example...
How can I put a wildcard to catch characters between the $ and 0??
OR
This is the way it gets rendered on the html if it's not $0.00
<em class="ProductPrice">$20.00</em>
Otherwise if it's $0.00 jQ changes it to
<em class="ProductPrice">Call for Shipping</em>
and before THAT the website renders this radio button (from the server-side code):
<label>
<input type="radio" name="selectedShippingMethod" value="0" style="vertical-align: bottom;">
"Call for Shipping"
</label>
I need to have ONLY the $0.00 or any dollar amount associated with this specific radio button or label changed to 'Call for Shipping', IF the label value is 'Call for Shipping' how can I do this??
Is it possible to only change the em value following this specific radio button?? If so, how??
Basically I must do:
<air code>
If <label> contains 'Call for Shipping'
and
<em> contains $*.*
then
replace $*.* with phrase 'Call for Shipping'
end if
Here is my jsfiddle: http://jsfiddle.net/STbk8/10/ or http://jsfiddle.net/STbk8/13/
jsHint is not helpful with the parens and brackets!! :( which I know are not correct but at least I have this in some sort of JS/jQ format for people to look at...
Actually I do not need to check for the <em> value but the em value is what must change.
I'm more a frontend html/css person, not a jQ/JS ninja :(
My current little one-liner will affect anything with $0.00 and I can't use a portion of $0.00 or that will mess up other things...
Thank you, Tom