VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-close-button-disabled-state/

⇱ Bootstrap 5 Close button Disabled state - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Close button Disabled state

Last Updated : 21 Nov, 2022

Bootstrap 5 Close button Disabled state is used to disable the close button for dismissing content like modals and alerts. The disabled close button changes the opacity and removes the pointer cursor on hovering.

Close Button Disabled State used Attribute: 

  • <disabled: The disabled attribute is used to disable the close button.

Syntax:

<button type="button" class="btn-close" 
 disabled aria-label="Close">
 ...
</button>
 

Example 1: In this example, we will create a simple disabled button.

Output:

👁 Image
 

Example 2: In this example, we will use a disabled close button in a Modal.

Output:

👁 Image
 

References: https://getbootstrap.com/docs/5.0/components/close-button/#disabled-state

Comment

Explore