Currently I have:
var price = \'$4000\'; var currency = price.match([\\$]); alert(currency);
However this doesn\'t seem to work. I would like t
If you want to find the dollar sign in any position use:
var currency = price.match(/\$/);
If you want to find the dollar sign at the beginning of the string use:
var currency = price.match(/^\$/);
Here's the documentation about Javascript RegExp