One of my website elements is a div that I want to hide when clicked. The element uses Bootstrap4 and has a CSS style called "d-none" which hides the element by setting display to none.
To achieve this functionality, I added the following code in my .js file:
$("#div").on("click", function(e, m) {
alert("Click event triggered!");
$("div").addClass("d-none");
});
However, I encountered an issue when trying to specify that it should utilize the style from bootstrap.min.css since I am using multiple CSS files simultaneously.
My attempt at specifying the CSS was as follows:
$("#div").on("click", function(e, m) {
alert("Click event triggered!");
$("div").addClass("../css/bootstrap.min.css/d-none");
});
Unfortunately, this approach did not work as expected. I am now seeking guidance on how to correctly specify the CSS for this particular element.