Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<textarea/> tag "swallows" html

Tags:

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>

like image 296
tessa Avatar asked Apr 14 '11 15:04

tessa


1 Answers

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

like image 143
Gary Chambers Avatar answered Oct 12 '22 13:10

Gary Chambers