Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
HTML5's hidden attribute is perfectly suitable for hiding elements that are made invisible by states.js based on #states.
When specified on an element, it indicates that the element is not yet, or is no longer, relevant. User agents should not render elements that have the hidden attribute specified.
Comments
Comment #1
casey CreditAttribution: casey commentedThis attribute is supported by all browsers but IE. We can however easily fix it for IE using some CSS
Comment #2
JacineRelated: #1372374: Adapt states.js to new required html5 attribute
Comment #3
theborg CreditAttribution: theborg commented@jacine thanks!
Just note that we should be aware of:
Comment #4
nod_#states is JS
Comment #5
nod_tag
Comment #6
nod_Still relevant.
Comment #18
nod_closing duplicate issue #1899836: Accessibility improvements for States API and porting credit+tags, this is now an accessibility improvement too :)