tarun Posted May 19, 2007 Share Posted May 19, 2007 Im Not Sure Whats Going Wrong Its Actually Trying To Litererally Replace "string" Rather Than A Specified Input function deltxt(where,string){ var old = document.getElementById(where).innerHTML; var new = old.replace(/string/g, ""); document.getElementById('taskbar').innerHTML = close; } Any Help...? Thnx, Tarun Link to comment https://forums.phpfreaks.com/topic/52131-jscript-replace/ Share on other sites More sharing options...
mainewoods Posted May 20, 2007 Share Posted May 20, 2007 try: function deltxt(where,string){ var regexp = '/' + string + '/g'; var old = document.getElementById(where).innerHTML; var new = old.replace(regexp, ""); alert(new); document.getElementById('taskbar').innerHTML = close; } Link to comment https://forums.phpfreaks.com/topic/52131-jscript-replace/#findComment-257340 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.