Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Textarea loses focus on mouse click?

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.

Here's a .gif showing my problem:

enter image description here

The code i'm using is valid 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.

I'm pretty stunned as to why this is happening, as it's usually Internet Explorer that gives me problems like this.

Anyone have any idea what's wrong?

like image 798
Joel Murphy Avatar asked Apr 18 '12 15:04

Joel Murphy


2 Answers

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>
like image 182
sbeliv01 Avatar answered Oct 18 '22 14:10

sbeliv01


You haven't closed your label tags properly. You have <label> when it should be </label>

like image 23
j08691 Avatar answered Oct 18 '22 14:10

j08691