I am running outta my mind now, can someone please explain what is happening here:
Why's the same JS function producing different results?
Here's the actual HTML:
<input id="xamount" data-pr-xamount="1" value="R 5 700,00" placeholder="Enter Amount" style="width: 88%;" class="valid" type="text">
Those spaces may not be traditional spaces, try splitting on actual white-space:
/\s+/
In your case:
$('[data-pr-xamount="1"]').last().val().split(/\s+/);
There must be a character different than a space between 5 and 7.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With