What is the role of the 'data-toggle' attribute in Bootstrap's JavaScript components?

  • It specifies the target element for a JavaScript event.
  • It activates the Bootstrap carousel component.
  • It toggles the visibility of a Bootstrap element.
  • It triggers the Bootstrap navigation collapse.
The correct answer is 'It toggles the visibility of a Bootstrap element.' The 'data-toggle' attribute is used in Bootstrap to toggle the visibility of a specified element. It is commonly used with components like collapse, dropdown, modal, etc. When 'data-toggle' is set to a specific value (e.g., 'collapse' or 'modal'), it triggers the corresponding Bootstrap functionality, making the element visible or hidden.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *