I would like to add css to a assigned span class if it contains a number higher than 55, also this must on a page load and not a button trigger.
Thanks any help would be great.
Example below: (currently not working)
<span class="subTotalPrice">10</span>
<span class="subTotalPrice">5</span>
<span class="subTotalPrice">125</span>
<span class="subTotalPrice">55</span>
<script>
$(".subTotalPrice:contains(> 55)").css({'color':'red', 'text-decoration':'underline'});
</script>
Here’s a good way of doing that using jQuery’s filter():