Bug Tracker

Modify

Ticket #9612 (closed bug: duplicate)

Opened 2 years ago

Last modified 2 years ago

$.attr('defaultSelected') returns undefined instead of true/false

Reported by: anonymous Owned by:
Priority: low Milestone: 1.next
Component: attributes Version: 1.6.1
Keywords: Cc:
Blocking: Blocked by:

Description

$('option').attr('defaultSelected') should return true or false for <option> elements. The attribute appears in the DOM but jQuery returns undefined.

This might have something to do with that attribute being read-only?

Change History

comment:1 Changed 2 years ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to duplicate
  • Status changed from new to closed
  • Component changed from unfiled to attributes

Thanks for taking the time to contribute to the jQuery project! This is a case where prop should be used instead since defaultSelected is not an attribute.

comment:2 Changed 2 years ago by timmywil

Duplicate of #9088.

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.