What are these things in BootStrap?

Q1) What are these things in BootStrap? What is their significance?

data-toggle=“collapse”
data-toggle=“dropdown”
data-target=“#navbar

aria-expanded=“false”
aria-controls=“navbar”
aria-haspopup=“true”

Q2) If I just put these codes in my non-Bootstrap HTML then will they do any work?

Thank you

The Bootstrap docs give a fair bit of info, such as this on collapse: http://v4-alpha.getbootstrap.com/components/collapse/

I haven’t used Bootstrap, but see if that helps.

The data attributes work with the bootstrap js to identify which elements will trigger the reveal of a submenu or collapsible section. The data-target identifies the element which is to be revealed or hidden. There are various attributes to identify whether the element is in the collapsed or non collapsed state at any time. They will not work without the bootstrap.js and css.

The aria attributes are used for accessibility to identify elements which have been hidden or act as toggle for more data and to provide additional semantics to elements where their use may not be obvious.

2 Likes

Thank you to both of you :slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.