In order for assistive technologies (such as screen readers) to convey that a series of buttons is grouped, an appropriate role attribute needs to be provided. Similarly, create split button dropdowns with virtually the same markup as single button dropdowns, but with the addition of .dropdown-toggle-split for proper spacing around the dropdown caret.. We use this extra class to reduce the horizontal padding on either side of the caret by 25% and remove the margin-left thats added for regular button dropdowns. for Bootstrap 5 & Vanilla JavaScript. With Bootstrap 3, we've rewritten the project to be mobile friendly from the start. For button groups, this would be role="group", while toolbars should have a role="toolbar".. Explanation of Code. Creating the Toasts with Bootstrap. Creating a button using Bootstrap 5. W3Schools offers free online tutorials, references and exercises in all the major languages of the web. On the dismiss button, add the data-dismiss="alert" attribute, which triggers the JavaScript functionality. Be sure to use the