Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#14144 closed bug (notabug)

IE10 Textarea's placeholder attribute gets returned for ".html()"

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:


jQuery: 1.9.1, 1.10.2, 2.0.3

Browser: IE10 (not IE9 or 8)

In IE10, when you get the html of a textarea element, you will get the placeholder value if there is no content.


$('<textarea placeholder="something"></textarea>').html() => 'something'

Change History (3)

comment:1 Changed 10 years ago by dmethvin

Resolution: notabug
Status: newclosed

That's sorta interesting. Works fine when you use .val() which is the correct API for getting form values.

comment:2 Changed 9 years ago by Douglas.Meyer

Sorry, I tried to make the example as simple as possible to show the problem. I am aware that .val() is the correct way of getting values. I saw the problem when I was looking at the elements from a server response (see the updated fiddle: http://jsfiddle.net/Douglas_Meyer/cYRKq/) it showed that the textarea was pre-populated with the placeholder text.

comment:3 Changed 9 years ago by anonymous

IMHO this is a bug in the innerHTML, innerText and outerHTML implementation of IE10 and IE11.

I send a bug report to Microsoft: https://connect.microsoft.com/IE/feedback/details/811408

Have a look at it for example and how to reproduces the problem.

Note: See TracTickets for help on using tickets.