I need to have html code displayed on a web page so users can cut and paste it. I have searched online for answers to this question but cannot find a tutorial.
have a look at this example... [color=navy]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
@ZnupiMar 17.2007 — #Yeah, just use the <pre> element ...[/QUOTE]
No. The <pre> Element makes the browser not ignore white space. It has nothing to do with tags. Change every < to < (lt=[b]l[/b]ower [b]t[/b]han) and every > to > (gt=[b]g[/b]reater [b]t[/b]han). Or, if you use PHP, you can just use htmlspecialchars("<something>"); which will return <something>
@Major_PayneMar 18.2007 — #You'all want to do this the hard way when there is a neat online tool to use. Not everyone will want to type the characters for every " < " & " > ". Tool will also provide proper breaks.
@the_treeMar 18.2007 — #You'all want to do this the hard way when there is a neat online tool to use. [/QUOTE]When did anyone suggest doing it manually?
@Major_PayneMar 19.2007 — #Just re-read the posts for other suggestions that pretty much suggested manual. No alternative was given, but I at least provided a link so the whole page can be converted for a cut and paste operation.
@the_treeMar 19.2007 — #All they suggested was doing exactly what Felgall's script aids you in, no-one said anything about how to do it. When I've ever had more than two <>s to represent I've used search and replace, which practically every text editor is equipped with.