[Home]Show HTML examples

HomePage | RecentChanges | Preferences | Newbie Help

HTML Basics

With Proper Markup

Converting Characters to Entities Quickly and Easily

The Textarea Hack

Jerry Muelver: Put the example code in a textarea as the textarea's contents in a form on your page:

<form>
<textarea rows="15" cols="60">
<h1>Showing HTML</h1>
<p>Here is some text</p>
<table border="1">
  <tr>
    <td> Some table content </td>
  </tr>
</table>
</textarea>
</form>

Kverens: It is also not infallible (speaking about placing HTML in textareas) - if you try the following, it _does_ display the <b>, but it also translates &lt; to <

<textarea> <b> &lt; </textarea>

If you try the following, it doesn't work:

<textarea> </textarea> </textarea>

David Dorward: <textarea> elements are designed to accept user input, not display output. It is poor usability to use an input control in this way (as you risk confusing users).

See Also


Comments --
HomePage | RecentChanges | Preferences | Newbie Help
This page is read-only | View other revisions
Last edited July 28, 2003 4:29 pm (diff)
Search:

This FAQ is happily hosted by Betadome Digital Media