< textarea/>标签"swallows"html [英] <textarea/> tag "swallows" html
问题描述
这是我一直苦苦挣扎几天的非常奇怪的问题.起初,我以为它与我们的应用程序中的某些内容有关,但是我将其简化为最简单的html页面,并且它仍在发生.基本上,无论何时,我都会在将HTML呈现为值之后将标记添加到html页面.< textarea></textarea>
解决了该问题,但我不明白为什么.我在这里很茫然,这一定是我不知道的非常简单的事情.
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.
在下面的示例中,段落标签显示为textarea的值.
In the following example the paragraph tags show up as the value of the textarea.
我正在使用IE8.
<html>
<head>
<title>About</title>
</head>
<body>
<textarea/>
<p align="center">
test
</p>
<p align="left">
test
</p>
</body>
推荐答案
< textarea>
不是自动关闭标签.应该将其重写为< textarea></textarea>
<textarea>
is not a self-closing tag. It should be re-written as <textarea></textarea>
这篇关于< textarea/>标签"swallows"html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!