I'm making some code that scans an item for its price, and the price is located inside a class "cash". The text inside the cash class looks like this
1,000
I need to find a way to convert it to just an integer, rather than a string with lots of empty white space I tried doing this
var cash = document.getElementsByClassName('cash')[0].innerHTML
var parser = parseInt(cash)
console.log(parser)
It just returns "1"
I need to also make it so that it gets rid of the comma, so if the price is 1,000, it will return 1000, and I need to be able to use it as an integer.