I'm having some strange issues with a textarea in Google Chrome.
我在谷歌浏览器中遇到了一些奇怪的问题。
The problem is, whenever I click on a textarea in Google Chrome, it will lose focus instantly, and go back to the previous input box. The problem doesn't happen if I press the tab key on my keyboard.
问题是,每当我点击Google Chrome中的textarea时,它都会立即失去焦点,然后返回上一个输入框。如果我按下键盘上的Tab键,则不会发生此问题。
Here's a .gif showing my problem:
这是一个.gif显示我的问题:
The code i'm using is valid html:
我正在使用的代码是有效的HTML:
<div class="inputborder rounded">
<label>Celebrity 1<label>
<div class="newline"></div>
<input type="text"/>
<div class="newline"></div>
<label>Tweet 1<label>
<div class="newline"></div>
<textarea>Y U NO WORK?!</textarea>
<div class="newline"></div>
</div>
I'm not using any javascript on the page yet, apart from the jQuery library.
除了jQuery库之外,我还没有在页面上使用任何javascript。
I'm pretty stunned as to why this is happening, as it's usually Internet Explorer that gives me problems like this.
我很惊讶为什么会发生这种情况,因为通常Internet Explorer会给我带来这样的问题。
Anyone have any idea what's wrong?
任何人都知道什么是错的?
2 个解决方案
#1
8
Try closing your label tags.
尝试关闭标签标签。
<div class="inputborder rounded">
<label>Celebrity 1</label>
<div class="newline"></div>
<input type="text"/>
<div class="newline"></div>
<label>Tweet 1</label>
<div class="newline"></div>
<textarea>Y U NO WORK?!</textarea>
<div class="newline"></div>
</div>
#2
3
You haven't closed your label tags properly. You have <label>
when it should be </label>
您尚未正确关闭标签标签。它应该是
#1
8
Try closing your label tags.
尝试关闭标签标签。
<div class="inputborder rounded">
<label>Celebrity 1</label>
<div class="newline"></div>
<input type="text"/>
<div class="newline"></div>
<label>Tweet 1</label>
<div class="newline"></div>
<textarea>Y U NO WORK?!</textarea>
<div class="newline"></div>
</div>
#2
3
You haven't closed your label tags properly. You have <label>
when it should be </label>
您尚未正确关闭标签标签。它应该是