so, I have an anchor that is getting called by replacing the space with a -
using the php str_replace
, now inside of the javascript hash I want to undo these changes so users will search for the words without these -
. any response would be appreciated.
var href = "a-b-c";
href = href.replace(/\-/g,"");
console.log(href);
Will work and replace all "-" instead one.
You can try here https://codepad.remoteinterview.io/MAZLREUGKE