【问题标题】:Allow user to type a paragraph using JavaScript [closed]允许用户使用 JavaScript 键入段落 [关闭]
【发布时间】:2014-04-25 18:13:31
【问题描述】:

有没有办法创建一个允许用户输入段落的框?我希望保存用户的输入。

【问题讨论】:

  • 你不能使用 HTML <textarea>吗?

标签: javascript typing iusertype


【解决方案1】:

<textarea>Type your stuff here</textarea>?

空白将被发送到服务器,并可能被保存。但是,要使其在输出中显示为这样:

<div style="white-space: pre-wrap">
Look at me!

See? No BR tags and yet I'm on a new line!

                    Also spaces. SPAAAAAAAAAAACE!
</div>

【讨论】:

  • 至于 hoping to save the paragraphs 部分,请阅读 PHP 或 ASP.Net 等服务器端语言。
【解决方案2】:
<form>
<textarea id="someid" rows="8" cols="40"></textarea>
</form>

这不行吗?

【讨论】:

    猜你喜欢
    • 2016-09-22
    • 1970-01-01
    • 2018-12-07
    • 2016-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-14
    • 2022-01-06
    相关资源
    最近更新 更多