Bug Tracker

Modify

Ticket #7179 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

.text on input element causes exception in IE

Reported by: ezra@… Owned by: ezra@…
Priority: undecided Milestone: 1.4.3
Component: unfiled Version: 1.4.2
Keywords: Cc:
Blocking: Blocked by:

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.

Change History

comment:1 Changed 4 years ago by snover

  • Owner set to ezra@…
  • Status changed from new to pending

Please supply a test case.

comment:2 Changed 4 years ago by addyosmani

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.

comment:3 Changed 4 years ago by ezra@…

  • Status changed from pending to new

comment:3 Changed 4 years ago by ezra@…

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.

comment:4 Changed 4 years ago by snover

  • Status changed from new to closed
  • Resolution set to invalid

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.