I have a string that's on the page and from which I want an array of int.
<div id="TheData">2,3,0,43,23,53</div>
I'm writing this:
var ArrayData = ($('#TheData').html()).split(',');
However, ArrayData
becomes an array of strings. How can I get an array of ints? Note that some of the elements in the HTML can be equal to 0
.
Thanks.