You need a /g on there, like this:
/g
var textTitle = "this is a test"; var result = textTitle.replace(/ /g, '%20'); console.log(result);
1.4m articles
1.4m replys
5 comments
57.0k users