diff --git a/docs/javascript/collapse.md b/docs/javascript/collapse.md index 3a25b6b947..40c27009ee 100644 --- a/docs/javascript/collapse.md +++ b/docs/javascript/collapse.md @@ -87,23 +87,12 @@ Extend the default collapse behavior to create an accordion with the panel compo {% endexample %} -You can also use the plugin without the accordion markup. Make a button toggle the expanding and collapsing of another element. -
Be sure to add aria-expanded
to the control element. This attribute explicitly defines the current state of the collapsible element to screen readers and similar assistive technologies. If the collapsible element is closed by default, it should have a value of aria-expanded="false"
. If you've set the collapsible element to be open by default using the in
class, set aria-expanded="true"
on the control instead. The plugin will automatically toggle this attribute based on whether or not the collapsible element has been opened or closed.
Additionally, if your control element is targetting a single collapsible element – i.e. the data-target
attribute is pointing to an id
selector – you may add an additional aria-controls
attribute to the control element, containing the id
of the collapsible element. Modern screen readers and similar assistive technologies make use of this attribute to provide users with additional shortcuts to navigate directly to the collapsible element itself.