I want to use str_replace or its similar alternative to replace some text in JavaScript.
str_replace
var text = \"this is some sample text that i want to re
You should write something like that :
var text = "this is some sample text that i want to replace"; var new_text = text.replace("want", "dont want"); document.write(new_text);