Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace all forward slash

Status
Not open for further replies.

fox12

Programmer
Jan 18, 2005
62
US
How can I cleanly replace all forward slashes "/" with "/ " in a page with javascript? I tried the following code:
document.body.innerHTML = document.body.innerHTML.replace(regstr, "\/ ");
But that seems to replace all occurrences of the "/" in the closing tags of the HTML source code.

thanks a lot.
 
To clarify, I mean I want to replace all "/" with "/&nbsp;", but not "</" in any html closing tag.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top