Bug Tracker

Modify

Ticket #6606 (closed bug: worksforme)

Opened 3 years ago

Last modified 3 years ago

jQuery(selector).val("") does not set value=""

Reported by: seasong Owned by:
Priority: Milestone: 1.4.3
Component: manipulation Version: 1.4.2
Keywords: empty string false val Cc:
Blocking: Blocked by:

Description

jQuery(selector).val() returns the value of the element in question, and does not alter the value at all, as it should.

jQuery(selector).val("") does exactly the same thing, however - you might as well not include the quote marks.

I have been getting around this with:

jQuery(selector).get(0).value = ""

While that *works*, I would prefer to not have to jump out of the jQuery object (and thus the jQuery mindset) to get something so basic done.

Change History

comment:1 Changed 3 years ago by dmethvin

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

This works for me, if it doesn't work for you please submit a test case.

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.