rppig
rppig

Reputation: 468

the position of cursor when first click a textarea

I found a problem that I am puzzled. It's just a simple , Under normal circumstances,when I click a textarea, the cursor is always at the beginning of the textarea,but today when i type the code like this

  <textarea rows="3"></textarea>

on a Chrome extesion web page,the cursor changes it's position with the click position. I swear there's no extra JS or css on the page

Upvotes: 1

Views: 1201

Answers (3)

Shams
Shams

Reputation: 565

There should not be a any space or in tab between <textarea></textarea> open and close tags.

If got space or tab between tags it will behave strangely.

Upvotes: 2

Igor Kulebyakin
Igor Kulebyakin

Reputation: 41

Check in your code if you have tabs in between opening and closing textarea tags. Some IDEs insert tabs upon auto-formatting.

Upvotes: 3

ron tornambe
ron tornambe

Reputation: 10780

I had the same strange problem. I hacked around it by using the following:

document.getElementById('element-id').innerText = '';

I would love to know the real reason for it occurring.

Upvotes: 0

Related Questions