Reputation: 27633
I want to show text on a web page without having to remember to go over it and check if there are any <
's and >
's in it, so simply copying the text from, say, notepad to visual studio isn’t good.
So I tried "paste alternate" but it adds line breaks, and keeps the original fonts etc. All I want is the text itself.
Is there an automatic way - via CSS or Visual Studio perhaps?
Upvotes: 0
Views: 82
Reputation: 8426
Found an answer that uses jQuery.
Use the .text()
function.
Will return all the text present in the HTML.
For example ($('<p>test</p>').text());
will produce test
EDIT
For string substitution you can try the javascript replace method. Call it on document load. It should solve the problem
str.replace(">",">");
Upvotes: 0