Use Element.classList and DOMTokenList.contains() to check if the element has the specified class. Source https://www.30secondsofcode.org/js/s/has-class
Use Window.getComputedStyle() to get the value of the CSS rule for the specified element.
Use Element.classList and DOMTokenList.remove() to remove the specified class from the element.
toggleClass toggles a class for an HTML element.
You can customize the look and feel of the browser’s scrollbar by changing some CSS properties.
To adjust its width based on its content dynamically, we create a fake element whose content is the same as the input value.
Check for the existence of an attribute (including data attributes) on an element. This method can also be used to manipulate other types of attributes—things like id, tabindex, name, and so on.
Get the actual computed style of an element. This factors in browser default stylesheets as well as external styles you’ve specified.
Get a style, and then if this style is not set as an inline style directly on the element, it returns an empty string.
The following function returns the default value of CSS property for given tagName.