javascript - 允许 HTML 文本框中有空格

标签 javascript html blogger

这是我现在在博客文章中的 Javascript 和 HTML 代码。

<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<script language="javascript" type="text/javascript">
function convertinput() {
    document.getElementById('output').value = "@@[0:[0:1: " + document.getElementById('first').value + "]]";
   document.getElementById('output').style.display = 'block';
}
</script>


<input id="first" maxLength=75 style="WIDTH: 300px;></input>
<br>
<input id="output" style="display:none;"></input>
<br>
<input type='button' onclick='convertinput()' value='convert'>
</div>

我无法在输入文本框中插入空格。
这是什么原因呢?解决办法是什么?

最佳答案

您缺少结束语"style="WIDTH: 300px;>

另一件事是</input>不是标签结束。它必须以这种方式关闭:

<input type="text" />

关于javascript - 允许 HTML 文本框中有空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13138686/

相关文章:

javascript - tinyMCE SetContent() 导致撤消步骤

javascript - 测验程序未按预期运行

javascript - jQuery UI 可拖动位置是否受 scrollTop 影响? (包括 JSFiddle)

javascript - 通过 Javascript 按 tab 键获取 selenium

eclipse - HTML Meta 的属性 - 标签在 eclipse 中抛出警告

java - Blogger - 根据标签检索博客

html - 导航背景透明度问题

jquery - 图片适合缩略图

javascript - 如何同时对多个ID使用javascript onkeyup

html - 如何使所有照片正常显示?