[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/API/Element/className [Back]  [Original]

Element.className - API | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Element.className

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..

className class .

: , className . element.classList - .

In this article

var cName = elem.className;
elem.className = cName;
  • cName - . , .

<div class="booble example"> </div>
js
var elm = document.querySelector("div");

alert(elm.className); //"booble example"

elm.className = "class1 class2 class3";
alert(elm.className); //"class1 class2 class3"

: className - , , DOM, class *.*


Web Proxy Viewer  |  New URL  |  Original Page