Looking to replace spaces in a variable to "%20". Only the first space is being replaced. I would like to replace all of them.
var Answer30Address = answer30.toString().replace(" ", "%20");
Looking to replace spaces in a variable to "%20". Only the first space is being replaced. I would like to replace all of them.
var Answer30Address = answer30.toString().replace(" ", "%20");
If you use regex it will replace all, this should do.
var Answer30Address = answer30.toString().replace(/ /g, "%20");