Chapter 9: Improving the Website with Interactive Features Using JavaScript
In this chapter, we will learn how to improve our website with different interactive features. These features will be created using JavaScript and, in most cases, the JavaScript-based components of Bootstrap 5. In the previous chapter, we customized the look of our website – in this chapter, we will customize the feel of our website.
Bootstrap 5 has several interactive components that use JavaScript. Some of them are initialized automatically via the use of data attributes, for example, the accordion, carousel, dropdown, offcanvas, navbar, modal, and tab components, which we are currently using on the website. Other components require custom initialization using JavaScript, which is the case for popover, toast, and tooltip components. Form validation requires custom JavaScript to be executed at the correct time, and the spinner component should only be visible when the browser is in a loading state...