JSFiddle - React, Tailwind, and code Playground

by zachreynolds

HTML

<table><tr><td class="weight"> 19456 <small><em> lb's </em></small><br>
<div class="shipping-weight"><small>*Note: Up to 20,000 lbs max.  For shipping requirements over 20,000 lb's call our</small><br>
<small>PRICING HOTLINE: 1-877-444-444 </small>
</div>
</td>
<td class="weight"> 20000 <small><em> lb's </em></small><br>
<div class="shipping-weight"><small>*Note: Up to 20,000 lbs max.  For shipping requirements over 20,000 lb's call our</small><br>
<small>PRICING HOTLINE: 1-877-444-444 </small>
</div>
</td></tr></table>

CSS

td {
    vertical-align: top;
}

.shipping-weight {
    display: none;
}

JavaScript

/*

$('.weight').filter(function () {
      var weight = parseInt(this.firstChild.textContent);
      if (weight >= 20000) {
        $('.shipping-weight').show();
      } else {
        $('.shipping-weight').hide();
      }
   });


*/


$('.weight').filter(function(index){
    var num = parseInt(this.firstChild.textContent);
    return num >= 10000;
}).find('.shipping-weight').show();