How To Remove A Class From Element With Javascript

Source URL: https://www.javascripttutorial.net/dom/css/remove-class-from-an-element/

Language: javascript

Created on: 2021-01-03 12:36:38

const div =  document.querySelector('div') // Get element from DOM
div.classList.remove('info') // Remove class "info"
This tutorial shows you how to remove one or more classes from an element using JavaScript DOM API.
content_copy