Bug Tracker

Modify

Ticket #11792 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

In the 1.7 version the tag select's can't be set with text

Reported by: effaceking@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocking: Blocked by:

Description

For example , write a tag like this <select id="test"><option value='0'>test1</option><option selected value='1'>test2</option></select>. Then I set the select like this:$("#test").find("option[text='test1']").attr("selected", "selected");

but it didn't work, it will work in the 1.6 version

Change History

comment:1 Changed 2 years ago by dmethvin

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

There is no text attribute, so it looks like we fixed the bug that incorrectly made this return an element in 1.6 or earlier. If you want to select an element based on the text inside it, you could try :contains() instead, or use a .filter() function looking at the .text property.

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.