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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access