| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ru/docs/Web/API/Element/className | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
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 - .
var cName = elem.className; elem.className = cName;
<div class="booble example"> </div>
var elm = document.querySelector("div");
alert(elm.className); //"booble example"
elm.className = "class1 class2 class3";
alert(elm.className); //"class1 class2 class3"
:
className - , , DOM, class *.*
This page was last modified on 17 . 2024 . by MDN contributors.
ElementactiveViewTransitionariaActiveDescendantElementariaAtomicariaAutoCompleteariaBrailleLabelariaBrailleRoleDescriptionariaBusyariaCheckedariaColCountariaColIndexariaColIndexTextariaColSpanariaControlsElementsariaCurrentariaDescribedByElementsariaDescriptionariaDetailsElementsariaDisabledariaErrorMessageElementsariaExpandedariaFlowToElementsariaHasPopupariaHiddenariaInvalidariaKeyShortcutsariaLabelariaLabelledByElementsariaLevelariaLiveariaModalariaMultiLineariaMultiSelectableariaOrientationariaOwnsElementsariaPlaceholderariaPosInSetariaPressedariaReadOnlyariaRelevantariaRequiredariaRoleDescriptionariaRowCountariaRowIndexariaRowIndexTextariaRowSpanariaSelectedariaSetSizeariaSortariaValueMaxariaValueMinariaValueNowariaValueTextassignedSlotattributeschildElementCountchildrenclassListclassNameclientHeightclientLeftclientTopclientWidthcurrentCSSZoomcustomElementRegistryelementTimingfirstElementChildidinnerHTMLlastElementChildlocalNamenamespaceURInextElementSiblingouterHTMLpartprefixpreviousElementSiblingrolescrollHeightscrollLeftscrollLeftMaxscrollTopscrollTopMaxscrollWidthshadowRootslottagNameafter()animate()append()ariaNotify()attachShadow()before()checkVisibility()closest()computedStyleMap()getAnimations()getAttribute()getAttributeNames()getAttributeNode()getAttributeNodeNS()getAttributeNS()getBoundingClientRect()getClientRects()getElementsByClassName()getElementsByTagName()getElementsByTagNameNS()getHTML()hasAttribute()hasAttributeNS()hasAttributes()hasPointerCapture()insertAdjacentElement()insertAdjacentHTML()insertAdjacentText()matches()moveBefore()prepend()pseudo()querySelector()querySelectorAll()releasePointerCapture()remove()removeAttribute()removeAttributeNode()removeAttributeNS()replaceChildren()replaceWith()requestFullscreen()requestPointerLock()scroll()scrollBy()scrollIntoView()scrollIntoViewIfNeeded()scrollTo()setAttribute()setAttributeNode()setAttributeNodeNS()setAttributeNS()setCapture()setHTML()setHTMLUnsafe()setPointerCapture()startViewTransition()toggleAttribute()afterscriptexecuteanimationcancelanimationendanimationiterationanimationstartauxclickbeforeinputbeforematchbeforescriptexecutebeforexrselectblurclickcompositionendcompositionstartcompositionupdatecontentvisibilityautostatechangecontextmenucopycutdblclickDOMActivateDOMMouseScrollfocusfocusinfocusoutfullscreenchangefullscreenerrorgesturechangegestureendgesturestartgotpointercaptureinputkeydownkeypresskeyuplostpointercapturemousedownmouseentermouseleavemousemovemouseoutmouseovermouseupmousewheelMozMousePixelScrollpastepointercancelpointerdownpointerenterpointerleavepointermovepointeroutpointeroverpointerrawupdatepointerupscrollscrollendscrollsnapchangescrollsnapchangingsecuritypolicyviolationtouchcanceltouchendtouchmovetouchstarttransitioncanceltransitionendtransitionruntransitionstartwebkitmouseforcechangedwebkitmouseforcedownwebkitmouseforceupwebkitmouseforcewillbeginwheelAbortControllerAbortSignalAbstractRangeAttrCDATASectionCharacterDataCommentCustomEventDOMErrorDOMExceptionDOMImplementationDOMParserDOMTokenListDocumentDocumentFragmentDocumentTypeEventEventTargetHTMLCollectionMutationObserverMutationRecordNamedNodeMapNodeNodeIteratorNodeListProcessingInstructionQuotaExceededErrorRangeShadowRootStaticRangeTextTreeWalkerXMLDocumentXPathEvaluatorXPathExpressionXPathResultXSLTProcessorYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |