Our volunteers haven't translated this article into বাংলা (বাংলাদেশ) yet. Join us and help get the job done!
You can also read the article in English (US).

 

The HTMLElement interface represents any HTML element. Some elements directly implement this interface, others implement it via an interface that inherits it.

Properties

Inherits properties from its parent, Element, and implements those from GlobalEventHandlers and TouchEventHandlers.

HTMLElement.accessKey
Is a DOMString representing the access key assigned to the element.
HTMLElement.accessKeyLabel Read only
Returns a DOMString containing the element's assigned access key.
HTMLElement.contentEditable
Is a DOMString, where a value of "true" means the element is editable and a value of "false" means it isn't.
HTMLElement.isContentEditable Read only
Returns a Boolean that indicates whether or not the content of the element can be edited.
HTMLElement.contextMenu
Is a HTMLMenuElement representing the contextual menu associated with the element. It may be null.
HTMLElement.dataset Read only
Returns a DOMStringMap with which script can read and write the element's custom data attributes (data-*) .
HTMLElement.dir
Is a DOMString, reflecting the dir global attribute, representing the directionality of the element. Possible values are "ltr", "rtl", and "auto".
HTMLElement.draggable
Is a Boolean indicating if the element can be dragged.
HTMLElement.dropzone Read only
Returns a DOMSettableTokenList reflecting the dropzone global attribute and describing the behavior of the element regarding a drop operation.
HTMLElement.hidden
Is a Boolean indicating if the element is hidden or not.
HTMLElement.inert
Is a Boolean indicating whether the user agent must act as though the given node is absent for the purposes of user interaction events, in-page text searches ("find in page"), and text selection.
HTMLElement.innerText
Represents the "rendered" text content of a node and its descendants. As a getter, it approximates the text the user would get if they highlighted the contents of the element with the cursor and then copied it to the clipboard.
HTMLElement.itemScope
Is a Boolean representing the item scope.
HTMLElement.itemType Read only
Returns a DOMSettableTokenList
HTMLElement.itemId
Is a DOMString representing the item ID.
HTMLElement.itemRef Read only
Returns a DOMSettableTokenList
HTMLElement.itemProp Read only
Returns a DOMSettableTokenList
HTMLElement.itemValue
Returns a Object representing the item value.
HTMLElement.lang
Is a DOMString representing the language of an element's attributes, text, and element contents.
HTMLElement.noModule
Is a Boolean indicating wether an import script can be executed in user agents that support module scripts.
HTMLElement.nonce
Returns the cryptographic number used once that is used by Content Security Policy to determine whether a given fetch will be allowed to proceed.
HTMLElement.offsetHeight Read only
Returns a double containing the height of an element, relative to the layout.
HTMLElement.offsetLeftRead only
Returns a double, the distance from this element's left border to its offsetParent's left border.
HTMLElement.offsetParentRead only
Returns a Element that is the element from which all offset calculations are currently computed.
HTMLElement.offsetTopRead only
Returns a double, the distance from this element's top border to its offsetParent's top border.
HTMLElement.offsetWidthRead only
Returns a double containing the width of an element, relative to the layout.
HTMLElement.properties Read only
Returns a HTMLPropertiesCollection
HTMLElement.spellcheck
Is a Boolean that controls spell-checking. It is present on all HTML elements, though it doesn't have an effect on all of them.
HTMLElement.style
Is a CSSStyleDeclaration, an object representing the declarations of an element's style attributes.
HTMLElement.tabIndex
Is a long representing the position of the element in the tabbing order.
HTMLElement.title
Is a DOMString containing the text that appears in a popup box when mouse is over the element.
HTMLElement.translate
Is a Boolean representing the translation.

Event handlers

Most event handler properties, of the form onXYZ, are defined on the GlobalEventHandlers or TouchEventHandlers interfaces and implemented by HTMLElement. In addition, the following handlers are specific to HTMLElement.

HTMLElement.oncopy 
Returns the event handling code for the copy event (bug 280959).
HTMLElement.oncut 
Returns the event handling code for the cut event (bug 280959).
HTMLElement.onpaste
Returns the event handling code for the paste event (bug 280959).
TouchEventHandlers.ontouchstart
Returns the event handling code for the touchstart event.
TouchEventHandlers.ontouchend
Returns the event handling code for the touchend event.
TouchEventHandlers.ontouchmove
Returns the event handling code for the touchmove event.
TouchEventHandlers.ontouchenter
Returns the event handling code for the touchenter event.
TouchEventHandlers.ontouchleave
Returns the event handling code for the touchleave event.
TouchEventHandlers.ontouchcancel
Returns the event handling code for the touchcancel event.

Methods

Inherits methods from its parent, Element.

HTMLElement.blur()
Removes keyboard focus from the currently focused element.
HTMLElement.click()
Sends a mouse click event to the element.
HTMLElement.focus()
Makes the element the current keyboard focus.
HTMLElement.forceSpellCheck()
Runs the spell checker on the element's contents.

Specifications

Specification Status Comment
CSS Object Model (CSSOM) View Module
The definition of 'HTMLElement' in that specification.
Working Draft Added the following properties: offsetParent, offsetTop, offsetLeft, offsetWidth, and offsetHeight.
HTML Living Standard
The definition of 'HTMLElement' in that specification.
Living Standard Added the following properties: translate, itemScope, itemType, itemId, itemRef, itemProp, properties, and itemValue.
Added the following method: forceSpellcheck().
Moved the onXYZ attributes to the GlobalEventHandlers interface and added an inheritance from it.
HTML5
The definition of 'HTMLElement' in that specification.
Recommendation Added the following properties: dataset, hidden, tabindex, accessKey, accessKeyLabel, draggable, dropzone, contentEditable, isContentEditable, contextMenu, spellcheck, commandType, commandLabel, commandIcon, commandHidden, commandDisabled, commandChecked, style, and all the onXYZ properties.
Moved the id and className properties to the Element interface.
Document Object Model (DOM) Level 2 HTML Specification
The definition of 'HTMLElement' in that specification.
Obsolete No change from Document Object Model (DOM) Level 2 HTML Specification
Document Object Model (DOM) Level 1 Specification
The definition of 'HTMLElement' in that specification.
Obsolete Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome ? Edge Full support YesFirefox Full support 1IE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
accessKeyChrome Full support 17Edge Full support YesFirefox Full support 5IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile Full support YesFirefox Android Full support 5Opera Android ? Safari iOS ? Samsung Internet Android ?
accessKeyLabelChrome ? Edge No support NoFirefox Full support 8IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile No support NoFirefox Android Full support 8Opera Android ? Safari iOS ? Samsung Internet Android ?
blurChrome ? Edge Full support YesFirefox Full support 5IE Full support 9Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile Full support YesFirefox Android Full support 5Opera Android ? Safari iOS ? Samsung Internet Android ?
clickChrome Full support 9
Notes
Full support 9
Notes
Notes Before Chrome 19, click is only defined on buttons and inputs.
Edge Full support YesFirefox Full support 3
Notes
Full support 3
Notes
Notes Before Firefox 5, click is only defined on buttons and inputs, and has no effect on text and file inputs.
IE Full support YesOpera Full support YesSafari Full support Yes
Notes
Full support Yes
Notes
Notes Before Safari 6, click is only defined on buttons and inputs.
WebView Android Full support Yes
Notes
Full support Yes
Notes
Notes Before Android WebView 4.4, click is only defined on buttons and inputs.
Chrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 5Opera Android Full support YesSafari iOS Full support Yes
Notes
Full support Yes
Notes
Notes Before Safari 6, click is only defined on buttons and inputs.
Samsung Internet Android ?
contentEditableChrome Full support YesEdge Full support YesFirefox Full support 3IE Full support 5.5Opera Full support 9Safari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
contextMenu
DeprecatedNon-standard
Chrome ? Edge Full support YesFirefox Full support 1IE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
datasetChrome Full support 8Edge Full support YesFirefox Full support 6IE Full support 11Opera Full support 11Safari ? WebView Android ? Chrome Android ? Edge Mobile Full support YesFirefox Android Full support 6Opera Android ? Safari iOS ? Samsung Internet Android ?
dirChrome ? Edge Full support YesFirefox Full support 1IE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
draggableChrome Full support YesEdge Full support YesFirefox Full support 2IE Full support YesOpera Full support 12Safari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
dropzoneChrome ? Edge Full support YesFirefox Full support 1IE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
focusChrome ? Edge Full support YesFirefox Full support 5IE Full support 9Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile Full support YesFirefox Android Full support 5Opera Android ? Safari iOS ? Samsung Internet Android ?
forceSpellCheck
Non-standard
Chrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
hiddenChrome ? Edge Full support YesFirefox Full support 1IE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
inertChrome Full support 60Edge Full support YesFirefox ? IE ? Opera Full support 47Safari ? WebView Android Full support 60Chrome Android Full support 60Edge Mobile ? Firefox Android ? Opera Android Full support 47Safari iOS ? Samsung Internet Android ?
isContentEditableChrome ? Edge Full support YesFirefox Full support 1IE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
itemId
Experimental
Chrome No support NoEdge No support NoFirefox Full support 6IE No support NoOpera No support 11 — 15Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
itemProp
Experimental
Chrome No support NoEdge No support NoFirefox Full support 6IE No support NoOpera No support 11 — 15Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
itemRef
Experimental
Chrome No support NoEdge No support NoFirefox Full support 6IE No support NoOpera No support 11 — 15Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
itemScope
Experimental
Chrome No support NoEdge No support NoFirefox Full support 6IE No support NoOpera No support 11 — 15Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
itemType
Experimental
Chrome No support NoEdge No support NoFirefox Full support 6IE No support NoOpera No support 11 — 15Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
itemValueChrome No support NoEdge No support NoFirefox Full support 6IE No support NoOpera No support 11 — 15Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
langChrome ? Edge Full support YesFirefox Full support 1IE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
noModuleChrome Full support 60Edge ? Firefox ? IE No support NoOpera Full support 47Safari ? WebView Android Full support 60Chrome Android Full support 60Edge Mobile ? Firefox Android ? Opera Android Full support 47Safari iOS ? Samsung Internet Android ?
nonceChrome Full support YesEdge Full support YesFirefox ? IE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?
offsetHeight
Experimental
Chrome ? Edge Full support YesFirefox Full support 1IE Full support YesOpera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
offsetLeft
Experimental
Chrome ? Edge Full support YesFirefox Full support 1IE Full support YesOpera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
offsetParent
Experimental
Chrome ? Edge Full support YesFirefox Full support 1IE Full support YesOpera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
offsetTop
Experimental
Chrome ? Edge Full support YesFirefox Full support 1IE Full support YesOpera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
offsetWidth
Experimental
Chrome ? Edge Full support YesFirefox Full support 1IE Full support YesOpera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
onModuleChrome Full support 60Edge ? Firefox ? IE ? Opera Full support 47Safari ? WebView Android Full support 60Chrome Android Full support 60Edge Mobile ? Firefox Android ? Opera Android Full support 47Safari iOS ? Samsung Internet Android ?
oncopy
Non-standard
Chrome ? Edge Full support YesFirefox Full support 3IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
oncut
Non-standard
Chrome ? Edge Full support YesFirefox Full support 3IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
onpaste
Non-standard
Chrome ? Edge Full support YesFirefox Full support 3IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
outerText
Non-standard
Chrome Full support YesEdge Full support YesFirefox No support NoIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android No support NoOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
spellcheckChrome ? Edge Full support YesFirefox Full support 2IE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
styleChrome Full support YesEdge Full support YesFirefox Full support Yes
Notes
Full support Yes
Notes
Notes Returns CSS2Properties, rather than CSSStyleDeclaration.
IE Full support YesOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
tabIndexChrome ? Edge Full support YesFirefox Full support 1IE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
titleChrome ? Edge Full support YesFirefox Full support 1IE ? Opera ? Safari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?
translate
Experimental
Chrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.

See also

ডকুমেন্ট ট্যাগ এবং অবদানকারী

সর্বশেষ হালনাগাদ করেছেন: chrisdavidmills,