Bug Tracker

Opened 13 years ago

Closed 12 years ago

#6776 closed enhancement (invalid)

.attr issue with readonly and disable

Reported by: DamianHall Owned by:
Priority: undecided Milestone: 1.4.3
Component: css Version: 1.4.2
Keywords: attributes, css, selectors Cc:
Blocked by: Blocking:


I noticed while working on a project that used a css selector input[readonly="readonly"] that for both readonly and disabled, the .attr function does not properly update the DOM. It puts in readonly="" and disabled="" instead of an actual value. I don't know if this was done intentionally or not, but I thought I'd bring it to the attention of the developers.

Functionally it works correctly, it's only in the case if a developer is trying to use the readonly="readonly" selector where it becomes an issue.

Change History (2)

comment:1 Changed 13 years ago by dmethvin

Component: manipulationcss

comment:2 Changed 12 years ago by snover

Priority: undecided
Resolution: invalid
Status: newclosed

In HTML, the mere presence of an attribute is what determines whether or not it is set. The correct way to query for a readonly or disabled element is simply input[readonly] or input[disabled].

Note: See TracTickets for help on using tickets.