You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of adding or removing a class, the checked state of the referenced element is toggled, or set to a predefined boolean if the optional force argument is provided.
The target usage are HTML toggles for CSS rules: A checkbox controls the styles in an adjacent sibling div. Best practice, though not mainstream due to JS prevalence.
We need the toggleChecked() action as using <label> would prevent propagating the click to an enclosing anchor, and conversely we cannot check a box when tapping on a nested anchor element.
Alternatives Considered
The toggleClass() action as a workaround fails when JS is turned off. The checkbox cannot be nested in <noscript> as this disrupts the adjacent sibling combinator. Also, noscript elements are typically repurposed in AMP environments to provide a fallback experience regardless whether JS is actually turned off.
Description
Instead of adding or removing a class, the checked state of the referenced element is toggled, or set to a predefined boolean if the optional
force
argument is provided.The target usage are HTML toggles for CSS rules: A checkbox controls the styles in an adjacent sibling div. Best practice, though not mainstream due to JS prevalence.
We need the
toggleChecked()
action as using<label>
would prevent propagating the click to an enclosing anchor, and conversely we cannot check a box when tapping on a nested anchor element.Alternatives Considered
The
toggleClass()
action as a workaround fails when JS is turned off. The checkbox cannot be nested in<noscript>
as this disrupts the adjacent sibling combinator. Also, noscript elements are typically repurposed in AMP environments to provide a fallback experience regardless whether JS is actually turned off.Additional Context
https://wordpress.org/plugins/anrghg/
The text was updated successfully, but these errors were encountered: