I want to make HTML appear as text to maybe write some snippets on a site. I know that there is a way to make < and > by using < and > but I would like something that were a bit easier to remember and quicker like maybe using jQuery to take the content from a snippet and turn it into regular text.
yehoshua2123
0
Newbie Poster
Recommended Answers
Jump to PostPut <pre></pre> tags around the snippet.
Jump to PostOops! I mixed up [code] and <pre>.
Now that I'm firing on two neurons, changing < to $lt; and > to > is the only way to do it. One method:
<html> <body> <script lang="javascript"> // Change all angle brackets in 'pre' tags function pre2Text() { var …
All 6 Replies
Fest3er
39
Posting Whiz in Training
yehoshua2123
0
Newbie Poster
Fest3er
39
Posting Whiz in Training
yehoshua2123
0
Newbie Poster
Fest3er
39
Posting Whiz in Training
Troy III
272
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.