21

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?

6
  • 12
    +1 for the animated gif.
    – CAbbott
    Commented Apr 18, 2012 at 15:07
  • 3
    +1 for your animation, unique way to present urself... :) Commented Apr 18, 2012 at 15:11
  • That has to be the best use of an image I've seen on this site! Commented Apr 18, 2012 at 15:11
  • Thank you :) I thought it would be the best way of showing you guys the problem. I'm not the best at explaining things you see ;) Commented Apr 18, 2012 at 15:12
  • 1
    "The code i'm using is valid html". Actually it's not. You didn't properly close your label tags.
    – j08691
    Commented Apr 18, 2012 at 15:22

2 Answers 2

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>
1
  • 1
    I can't believe I missed this out. This is embarrassing haha. 7 up votes, and such a simple "problem". I need to go sleep... Thank you - voted your answer as the solution as you were first. Commented Apr 18, 2012 at 15:24
3

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

1
  • I can't believe I missed this out. This is embarrassing haha. 7 up votes, and such a simple "problem". I need to go sleep... Thank you. Commented Apr 18, 2012 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.