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.


casey’s picture

This attribute is supported by all browsers but IE. We can however easily fix it for IE using some CSS

*[hidden] {
  display: none;
Jacine’s picture

theborg’s picture

@jacine thanks!

Just note that we should be aware of:

The hidden attribute must not be used to hide content that could legitimately be shown in another presentation. For example, it is incorrect to use hidden to hide panels in a tabbed dialog, because the tabbed interface is merely a kind of overflow presentation

nod_’s picture

Component:base system» javascript

#states is JS

nod_’s picture

Issue tags:-html5