JSFiddle - React, Tailwind, and code Playground
HTML
<input tabIndex="0" title="Please enter transaction amount." id="TR_Amount" style="width: 425px;" maxLength="10" value="" />
<input name="TR_Amount" type="hidden" value="" />
<BR />
<input tabIndex="0" title="" class="InfoColor" id="check_amt" style="width: 141px;" maxLength="30" readOnly="" value="" />
<input name="check_amt" type="hidden" value="10.00" />
<BR />
<DIV>
<LABEL title="" class=DefaultBold>Reserve Amount:
<LABEL tabIndex=-1 title="" class=AttentionColor id="lblAmt">$9.99</LABEL>
</LABEL>
</DIV>
<button onclick="amtGreatRes();">Click me</button>
JavaScript
function amtGreatRes() {
var ChkAmount = parseFloat($('input[name="check_amt"]').val()); // Works
var ReserveAmt = parseFloat($('#lblAmt').text().replace('$', '')); // My confusion
//alert(ReserveAmt);
if (ChkAmount > ReserveAmt) {
alert('The payment amount entered exceeds the reserve amount for this transaction. Please correct payment amount.');
} else {
alert('You did it!');
}
}