VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-toasts-hide-method/

⇱ Bootstrap 5 Toasts hide() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Toasts hide() Method

Last Updated : 30 Jul, 2024

Bootstrap 5 Toasts are a type of alert box that is used to show a message or an update to the user. For example, submitting a form, clicking a button, or maybe a push notification inside the website. The alert box type of toast is shown for a couple of seconds. 

The hide() method is used to hide the toast from the display.

Syntax:

toast.hide()

Return Value: This method returns to the caller before the toast has actually been hidden.

Example 1: The example below demonstrates the usage of the Toasts hide() Method using buttons that hides/closes the toast.

Output:

👁 file

Example 2: The example below demonstrates the usage of the Bootstrap 5 Toasts hide() Method using buttons and with the stacking of the toasts.

Output:

👁 a

Reference:https://getbootstrap.com/docs/5.0/components/toasts/#hide

Comment
Article Tags:

Explore