Skip to main content

Bug Tracker

Side navigation

#7179 closed bug (invalid)

Opened October 13, 2010 03:45PM UTC

Closed October 13, 2010 09:26PM UTC

.text on input element causes exception in IE

Reported by: ezra@creativemonkeys.nl Owned by: ezra@creativemonkeys.nl
Priority: undecided Milestone: 1.4.3
Component: unfiled Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

When calling .text(0) on an input element IE throws an exception. appendChild() probably doesn't exists on a input element. It works fine in Firefox.

Calling the appropriate .val(0) function works just fine in all browsers.

Attachments (0)
Change History (5)

Changed October 13, 2010 06:57PM UTC by snover comment:1

owner: → ezra@creativemonkeys.nl
status: newpending

Please supply a test case.

Changed October 13, 2010 07:33PM UTC by addyosmani comment:2

I've recreated a test case for this and tested in IE but it appears to be working fine - please also mention the version of IE that you are testing on when replying back.

Changed October 13, 2010 08:53PM UTC by ezra@creativemonkeys.nl comment:3

status: pendingnew

Changed October 13, 2010 08:53PM UTC by ezra@creativemonkeys.nl comment:4

Very simple test case using jsFiddle

http://jsfiddle.net/Fp7BT/

Tested on IE6 and IE8 and both throw an exception.

Also it doesn't matter if the input is of type text or hidden.

Changed October 13, 2010 09:26PM UTC by snover comment:5

resolution: → invalid
status: newclosed

Thanks for the report, but this is not a bug. Input elements cannot have children, so your attempt to <input></input> is invalid. If you want to set the value of an element, use .val.