:read-only and :read-write
Widely available since 2023-01-28
The :read-only
and :read-write
CSS pseudo-classes match elements that are read-only or read-write, respectively. For example, :read-only
matches <input>
and <textarea>
elements with the readonly
attribute.
Learning resources on MDN
Browser support (view on caniuse.com)
- Chrome 1 Released on 2008-12-11
- Chrome Android 18 Released on 2012-06-27
- Edge 13 Released on 2015-11-12
- Firefox 78 Released on 2020-06-30
- Firefox for Android 79 Released on 2020-07-28
- Safari 4 Released on 2009-06-08
- Safari on iOS 3.2 Released on 2010-04-03
Specifications
- HTML Standard (#selector-read-only), from HTML Workstream (WHATWG).
- Selectors Level 4 (#rw-pseudos), from Cascading Style Sheets (CSS) Working Group (W3C).