js remove class
//remove a css class from an element
document.getElementById("myElementID").classList.remove("class_name"); const div = document.querySelector('div') // Get element from DOM
div.classList.remove('info') // Remove class "info"document.getElementsByClassName("legend").style.display="none";$('#toggle li').on('click', function () {
$(this).toggleClass('open')
});const removeClass = (element, name) => {
const pattern = new RegExp('(?:^|\\s)'+ name + '(?:\\s|$)', 'g');
element.className = element.className.replace(pattern, "");
};
Also in JavaScript:
- format JSON code javascript
- bootstrap cdn for jquery
- datetime to date javascript
- react admin newrecords.foreach is not a function
- javascript show stack trace
- get the state of a checkbox
- create dynamic fields in react
- if statemnt shorthand js without else
- how to see my timezone using js
- alpine js open outside div
- angular bootstrap
- angular countdown timer
- json object check if key exists java
- how to use the map method in javascript
- webpack Module not found: Error: Can't resolve '../
- invoking jquery validator
- computed setter
- listar objetos javascript
- document.title you clicked count times
- how to make a ping in discord.js
- hide show jquery
- dropdown using ajax and django
- how to access model data in jsp spring mvc
- redirect users to anmother page in javascript