How it works…

To achieve Bootstrap 4 alert look, we used the addStyle() method by passing it two parameters. The first one was a made-up name of bs4success. The second parameter was an object. We passed certain key-value pairs to the object, and thus determined the HTML structure and the base classes to use in CSS. Then, finally, when we called the plugin, we passed it two arguments to the function call. The first one was a string with the message we want to show in our alert, and the second one was an object with key-value pairs to use to override the default behavior of the plugin. Note the third key-value pair, where we gave the value of bs4success, our made-up name of the first parameter of the plugin function definition, to the style ...

Get Bootstrap 4 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.