Skip to main content

Bug Tracker

Side navigation

#14144 closed bug (notabug)

Opened July 17, 2013 06:25PM UTC

Closed July 18, 2013 02:43AM UTC

Last modified December 12, 2013 01:09PM UTC

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

Reported by: 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'
Attachments (0)
Change History (3)

Changed July 18, 2013 02:43AM UTC by dmethvin comment:1

resolution: → notabug
status: newclosed

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

Changed August 08, 2013 07:23PM UTC by Douglas.Meyer comment:2

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: it showed that the textarea was pre-populated with the placeholder text.

Changed December 12, 2013 01:09PM UTC by anonymous comment:3

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

I send a bug report to Microsoft:

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