tessa tessa - 7 months ago 18
HTML Question

<textarea/> tag "swallows" html

This is a very strange problem I've been struggling with for a few days. At first I thought it was related to something in our application, but I've stripped it down to the simplest html page and it's still happening. Basically anytime I add a tag to a page the html after it gets rendered as it's value.

<textarea></textarea>
fixes the issue, but I don't understand why. I'm at a loss here, it has to be something really simple that I just don't know.

In the following example the paragraph tags show up as the value of the textarea.

I'm using IE8.

<html>
<head>
<title>About</title>
</head>
<body>

<textarea/>
<p align="center">
test
</p>
<p align="left">
test
</p>


</body>



Answer

<textarea> is not a self-closing tag. It should be re-written as <textarea></textarea>