Skip to main content
added 55 characters in body
Source Link
Sergio
  • 28.9k
  • 11
  • 90
  • 132

You need to use className.

Try:

div[0].className = "tagging";

If you want to add tha class to the existing one you can use:

div[0].className += " tagging"; // adding white-space is important

Demo here

To read: MDN className.

You need to use className.

Try:

div[0].className = "tagging";

If you want to add tha class to the existing one you can use:

div[0].className += " tagging"; // adding white-space is important

To read: MDN className.

You need to use className.

Try:

div[0].className = "tagging";

If you want to add tha class to the existing one you can use:

div[0].className += " tagging"; // adding white-space is important

Demo here

To read: MDN className.

added 19 characters in body
Source Link
Talha Akbar
  • 10.1k
  • 7
  • 41
  • 62

You need to use className.

Try:

div[0].className = "tagging";

If you want to add tha class to the existing one you can use:

div[0].className =+= div[0].className+" "tagging";tagging"; // adding white-space is important

To read: MDN className.

You need to use className.

Try:

div[0].className = "tagging";

If you want to add tha class to the existing one you can use:

div[0].className = div[0].className+ "tagging";

To read: MDN className.

You need to use className.

Try:

div[0].className = "tagging";

If you want to add tha class to the existing one you can use:

div[0].className += " tagging"; // adding white-space is important

To read: MDN className.

Source Link
Sergio
  • 28.9k
  • 11
  • 90
  • 132

You need to use className.

Try:

div[0].className = "tagging";

If you want to add tha class to the existing one you can use:

div[0].className = div[0].className+ "tagging";

To read: MDN className.