What does data-toggle
attributes do in Twitter Bootstrap? I couldn't find an answer in Bootstrap API.
I have seen a similar question before as well, link.
But it didn't help me much.
htmljavascriptjquerytwitter-bootstrap
What does data-toggle
attributes do in Twitter Bootstrap? I couldn't find an answer in Bootstrap API.
I have seen a similar question before as well, link.
But it didn't help me much.
Best Answer
It is a Bootstrap data attribute that automatically hooks up the element to the type of widget it is. Data-* is part of the html5 spec, and data-toggle is specific to Bootstrap.
Some Examples:
Go through the Bootstrap JavaScript docs and search for data-toggle and you will see it used in the code examples.
One working example: