HTMLElement
L'interfaccia HTMLElement
rappresenta un qualsiasi elemento HTML. Alcuni elementi implementano direttamente questa interfaccia, altri la implementano attraverso un'interfaccia che la eredita.
Proprietà
Eredita le proprietà dai propri genitori, da Element
e da GlobalEventHandlers
.
Nome | Tipo | Descrizione |
---|---|---|
HTMLElement.accessKey (en-US) |
DOMString |
La chiave d'accesso assegnata all'elemento. |
HTMLElement.accessKeyLabel (en-US) |
DOMString |
Una stringa che rappresenta la chiave d'accesso assegnata all'elemento. |
HTMLElement.contentEditable (en-US) |
DOMString |
Ritorna o assegna la modificabilità dell'elemento. |
HTMLElement.isContentEditable (en-US) Read only |
Boolean (en-US) |
Indica se il contenuto dell'elemento sia modificabile. |
HTMLElement.dataset (en-US) Read only |
DOMStringMap (en-US) |
Permette di leggere e scrivere attributi personalizzati (data-* ) nell'elemento. |
HTMLElement.dir (en-US) |
DOMString |
Ritorna o assegna la direzione dell'elemento |
HTMLElement.draggable |
Boolean (en-US) |
|
HTMLElement.dropzone Read only |
DOMSettableTokenList |
|
HTMLElement.hidden (en-US) |
Boolean (en-US) |
|
HTMLElement.itemScope |
Boolean (en-US) |
|
HTMLElement.itemType Read only |
DOMSettableTokenList |
|
HTMLElement.itemId |
DOMString |
|
HTMLElement.itemRef Read only |
DOMSettableTokenList |
|
HTMLElement.itemProp Read only |
DOMSettableTokenList |
|
HTMLElement.itemValue |
any |
|
HTMLElement.lang (en-US) |
DOMString |
Ritorna o assegna la lingua di un attributo, di un elemento, del testo e del contenuto di un elemento. |
HTMLElement.offsetHeight Read only |
double |
L'altezza di un elemento, relativa al layout. |
HTMLElement.offsetLeft (en-US)Read only |
double |
La distanza tra il bordo sinistro dell'elemento e il bordo sinistro del suo offsetParent . |
HTMLElement.offsetParent (en-US)Read only |
Element |
L'elemento a partire dal quale tutti i calcoli dell'offset sono effettuati. |
HTMLElement.offsetTop (en-US)Read only |
double |
La distanza tra il bordo superiore dell'elemento e il bordo superiore del suo offsetParent . |
HTMLElement.offsetWidth (en-US)Read only |
double |
La larghezza di un elemento, relativa al layout. |
HTMLElement.properties Read only |
HTMLPropertiesCollection |
|
HTMLElement.spellcheck |
Boolean (en-US) |
Controlla il controllo ortografico (presente in tutti gli elementi HTML) |
HTMLElement.style (en-US) |
CSSStyleDeclaration (en-US) |
Un oggetto che rappresenta la dichiarazione degli attributi di stile di un elemento. |
HTMLElement.tabIndex (en-US) |
long |
Ritorna o assegna la posizione di un elemento nell'ordine di tabbing. |
HTMLElement.title (en-US) |
DOMString |
Una stringa che appare in un popup quando il mouse si trova sopra all'elemento. |
HTMLElement.translate |
Boolean (en-US) |
Gestori degli eventi
Le proprietà degli eventi, nella forma onXYZ
, sono definite nei GlobalEventHandlers
implementati da HTMLElement
. Alcune altre sono specifiche per HTMLElement
.
HTMLElement.onTouchStart
- Restituisce il codice di gestione dell'evento
touchstart (en-US)
. HTMLElement.onTouchEnd
- Restituisce il codice di gestione dell'evento
touchend (en-US)
. HTMLElement.onTouchMove
- Restituisce il codice di gestione dell'evento
touchmove (en-US)
. HTMLElement.onTouchEnter
- Restituisce il codice di gestione dell'evento
touchenter
. HTMLElement.onTouchLeave
- Restituisce il codice di gestione dell'evento
touchleave
. HTMLElement.onTouchCancel
- Restituisce il codice di gestione dell'evento
touchcancel (en-US)
.
Metodi
Eredita i metodi dal genitore, Element
.
Nome e argomenti | Restituisce | Descrizione |
---|---|---|
HTMLElement.blur() (en-US) |
void |
Rimuove il focus della tastiera dall'elemento attualmente in focus. |
HTMLElement.click() (en-US) |
void |
Invia un evento di clic del mouse all'elemento. |
HTMLElement.focus() (en-US) |
void |
Porta il focus della tastiera sull'elemento. |
HTMLElement.forceSpellCheck() (en-US) |
void |
Specifiche
Specifica | Stato | Commenti |
---|---|---|
CSS Object Model (CSSOM) View Module The definition of 'HTMLElement' in that specification. |
Working Draft | Aggiunge le seguenti proprietà: offsetParent , offsetTop , offsetLeft , offsetWidth , e offsetHeight . |
HTML Living Standard The definition of 'HTMLElement' in that specification. |
Living Standard | Aggiunge le seguenti proprietà: translate , itemScope , itemType , itemId , itemRef , itemProp , properties , e itemValue .Aggiunti i seguenti metodi: forceSpellcheck() .Spostati gli attributi onXYZ all'interfaccia GlobalEventHandlers e aggiunta la sua ereditarietà. |
HTML5 The definition of 'HTMLElement' in that specification. |
Recommendation | Aggiunge le seguenti proprietà: dataset , hidden , tabindex , accessKey , accessKeyLabel , draggable , dropzone , contentEditable , isContentEditable , contextMenu , spellcheck , commandType , commandLabel , commandIcon , commandHidden , commandDisabled , commandChecked , style , e tutte le proprietà onXYZ .Spostate le proprietà id e className all'interfaccia Element . |
Document Object Model (DOM) Level 2 HTML Specification The definition of 'HTMLElement' in that specification. |
Obsolete | Nessun cambiamento da Document Object Model (DOM) Level 2 HTML Specification |
Document Object Model (DOM) Level 1 Specification The definition of 'HTMLElement' in that specification. |
Obsolete | Definizione iniziale. |
Compatibilità con i browser
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help! (en-US)
Funzionalità | Firefox (Gecko) | Chrome | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Supporto di base | 1.0 (1.7 or earlier) | ? | ? | ? | ? |
accessKey (en-US) |
5.0 (5.0) | 17.0 | ? | ? | (Yes)(535.10) |
accessKeyLabel (en-US) |
8.0 (8.0) | ? | ? | ? | No supportWebKit bug 72715 |
blur() (en-US) |
5.0 (5.0) | ? | ? | ? | ? |
click() (en-US) |
5.0 (5.0) | ? | ? | ? | (Yes)(535.24) |
dataset (en-US) |
6.0 (6.0) | 9.0 | ? | 11.10 | 5.1 |
focus() (en-US) |
5.0 (5.0) | ? | ? | ? | ? |
contentEditable (en-US) |
3.0 (1.9) | (Yes) | 5.5 | 9 | (Yes) |
spellcheck |
2.0 (1.8.1) | ? | ? | ? | ? |
forceSpellCheck() (en-US) |
No support | No support | No support | No support | No support |
dataset (en-US) |
6.0 (6.0) | 8.0 | 11 | 11.10 | 6 |
draggable |
(Yes) | ? | ? | 12.0 | ? |
dropzone |
No support | No support | No support | 12.0 | No support |
offsetLeft (en-US), offsetTop (en-US), offsetParent (en-US), offsetHeight and offsetWidth (en-US) |
(Yes) | ? | (Yes) | ? | ? |
translate |
No support | No support | No support | No support | No support |
itemScope , itemType , itemRef , itemId , itemProp , and itemValue |
6.0 (6.0) | No support | No support | 11.60 (Removed in Opera 15) |
No support |
properties |
(Yes) | ? | ? | ? | ? |
HTMLElement.ontouchstart , HTMLElement.ontouchend , HTMLElement.ontouchmove , HTMLElement.ontouchenter , HTMLElement.ontouchleave , and HTMLElement.ontouchcancel |
(Yes) | (Yes) | No support | ? | (Yes) |
Funzionalità | Firefox Mobile (Gecko) | Android | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Supporto di base |
1.0 (1.0) |
? | ? | ? | ? |
accessKey (en-US) |
5.0 (5.0) | ||||
accessKeyLabel (en-US) |
8.0 (8.0) | ||||
blur() (en-US) |
5.0 (5.0) | ||||
click() (en-US) |
5.0 (5.0) | ||||
dataset (en-US) |
6.0 (6.0) | ||||
focus() (en-US) |
5.0 (5.0) |