Bug Tracker

Opened 9 years ago

Closed 9 years ago

#15190 closed bug (notabug)

Cannot get or set custom properties

Reported by: Evert Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.1
Keywords: Cc:
Blocked by: Blocking:

Description

First things first, I've searched for similar tickets and yes I found the one were somebody confused props with attributes. I am not making the same mistake here.

http://jsfiddle.net/PHqS9/2/

It does work with .attr('prop', 'prop') but I don't want to add prop="prop" to the element, I just want to add prop.

Change History (1)

comment:1 Changed 9 years ago by gibson042

Resolution: notabug
Status: newclosed

I found the one were somebody confused props with attributes. I am not making the same mistake here.

I'm afraid you are, because […] selectors target attributes, not properties. And only attributes recognized as boolean by the client lack a proper string value. You can, however, adopt a convention for indicating truth/falsehood and check for your expected value with [attr="<true value>"] or [attr!="<false value>"], respectively.

Last edited 9 years ago by gibson042 (previous) (diff)
Note: See TracTickets for help on using tickets.