JavaScript Element Properties

You are Here:

JavaScript Element Properties

The following are the list of Element properties available in JavaScript programming.

FunctionsExplanation
accessKeyGets or sets the accesskey attribute of an element.
accessKeyLabelReturns a String that represents the element's assigned access key (if any).
attributesGets a collection of all attribute nodes registered to the specified node.
classListReturns a live DOMTokenList collection of the class attributes of the element.
classNameGets and sets the value of the class attribute of the specified element.
clientHeightReturns the inner height of an element, in pixels.
clientLeftReturns the width of the left border of an element, in pixels.
clientTopReturns the width of the top border of an element, in pixels.
clientWidthReturns the inner width of an element, in pixels.
contentEditableGets or sets whether the content of an element is editable or not.
datasetGets or sets all the custom data attributes (data-*) set on the element.
dirGets or sets the text writing directionality of the content of the current element.
hiddenGets or sets the hidden status of the specified element.
isContentEditableReturns a Boolean value indicates whether the contents of the element are editable or not.
innerHTMLGets or sets the HTML or XML markup contained within the element.
innerTextGets or sets the text content of the specified node, and all its descendants.
langGets or sets the base language of an element's attributes, text, and content.
localNameReturns a DOMString representing the local part of the element's qualified name.
nextElementSiblingReturns the element immediately following the specified element.
outerHTMLGets the outer HTML (including the opening and closing tags) of an element.
outerTextAs a setter, it removes the current node and replaces it with the given text. As a getter, it it returns the same value as element.innerText.
offsetHeightReturns the height of an element, including vertical padding and borders, as an integer.
offsetLeftReturns the margin-left of an element with respect to it parent element.
offsetParentReturns a reference to the object which is the closest positioned containing element.
offsetTopReturns the margin-top of an element with respect to it parent element.
offsetWidthReturns the width of an element, including horizontal padding and borders, as an integer.
previousElementSiblingReturns the element immediately preceding the specified element.
scrollHeightReturns the total height of an element, in pixels.
scrollLeftGets or sets the number of pixels an element's content is scrolled horizontally.
scrollTopGets or sets the number of pixels that an element's content is scrolled vertically.
scrollWidthReturns the total width of an element, in pixels.
shadowRootReturns the open shadow root that is hosted by the element, null if no open shadow root is present.
styleGets or sets the inline style of an element.
tabIndexGets or sets the value of the tabindex attribute of an element.
tagNameReturns the name of the tag for the given element.
titleGets or sets the value of the title attribute of an element.

Reminder

Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in JavaScript.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author