Joel Murphy
Joel Murphy

Reputation: 2512

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?

Upvotes: 21

Views: 4201

Answers (2)

j08691
j08691

Reputation: 207923

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

Upvotes: 3

sbeliv01
sbeliv01

Reputation: 11830

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>

Upvotes: 8

Related Questions