Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

how to remove particular class from the element in javascript code example

Example: js remove class

const removeClass = (element, name) => {
    const pattern = new RegExp('(?:^|\\s)'+ name + '(?:\\s|$)', 'g');
    element.className = element.className.replace(pattern, "");
};

Tags:

Javascript Example

Related

.bin/webpack-dev-server: no such file or directory: unknown code example text full area css code example order query sequelize code example access argv in c code example sql count chars in string code example matrix find determinant code example wordpress menu code example simple example javascript website html select search code example how to unistall mysql on mac code example css how to make text area fixed code example how dom works code example

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy