Back to the index.
This compatibility table details support for methods and properties specific to HTML elements.
This is the mobile table. See also the desktop table.
Last major update on 22 September 2014.
innerHTML
is one of the most-often used properties, since it’s so easy (not to mention fast) to take a string that contains HTML and feed it to the browser’s HTML parser. In general it works really well.
It has a few friends you should know about.
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 | ||||||||
innerHTML
The HTML contained by a tag, as a string.Originally a Microsoft extension, innerHTML is so useful that all other browsers support it, too. Test page | Yes | Yes | Yes | Yes | Yes | Incom |
Yes | Incom |
Almost | Yes | ||||||||||||||
x.innerHTML x.innerHTML = "Let's <u>change</u> it!" Get or set the HTML contained by node
|
||||||||||||||||||||||||
innerText
The text contained by a tag.
Test page |
Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | No | |||||||||||||||
x.innerText x.innerText = "Let's change it!" Get or set the text contained by node Cross browser: var text = x.textContent || x.innerText |
||||||||||||||||||||||||
insertAdjacentElement
Add a DOM node next to an existing node
Test page |
Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | No | |||||||||||||||
x.insertAdjacentElementL(position,DOM_node) Takes two arguments: the position (see below) and the DOM node to be inserted. Positions:
|
||||||||||||||||||||||||
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 | ||||||||
insertAdjacentHTML
Add an HTML string next to an existing node
Test page |
Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | |||||||||||||||
x.insertAdjacentHTML(position,HTML_string) Takes two arguments: the position (see below) and the HTML string to be inserted. Positions:
|
||||||||||||||||||||||||
outerHTML
The HTML of a tag, including the tag itself.
Test page |
Yes | Yes | Yes | Yes | Yes | No | Yes | Almost | Yes | |||||||||||||||
x.outerHTML x.outerHTML = "Let's <u>change</u> it!" Get or set the HTML of the entire node
|
||||||||||||||||||||||||
outerText
The text of a tag, including the tag itself.
Test page |
Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | No | |||||||||||||||
x.outerText x.outerText = "Let's change it!" Get or set the text contained by node See |
||||||||||||||||||||||||
textContent
The text contained by a tag.
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.textContent x.textContent = "Let's change it!" Get or set the text contained by node Cross browser: var text = x.textContent || x.innerText |
||||||||||||||||||||||||
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 |
There are a few properties that exist for any HTML element. They’re treated below.
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 | ||||||||
classList
A list of class values
Test page |
Yes | No | Yes | Yes | Yes | Yes | Yes | No | Yes | No | Yes | Yes | ||||||||||||
x.classList An array with all the class names of element It also has the following methods:
|
||||||||||||||||||||||||
className
The class attribute.
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.className x.className = 'blue' Get or set the value of the |
||||||||||||||||||||||||
dataset
A list of data- attributes
Test page |
Yes | No | Yes | Yes | Yes | Yes | No | Yes | No | Yes | No | Yes | Yes | |||||||||||
x.dataset Grants access to all
So the |
||||||||||||||||||||||||
dir
The dir attribute.
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | ||||||||||||||
x.dir x.dir = 'rtl' Get or set the text direction (ltr or rtl, left to right or right to left) of element |
||||||||||||||||||||||||
id
The id attribute.
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.id x.id = 'otherID' Get or set the id of node |
||||||||||||||||||||||||
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 |
There are two methods specifically for select boxes. There used to be browser incompatibilities between the two versions of add()
, which is why I test both of them. The problems have disappeared.
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 | ||||||||
add(opt,opt)
Add an option to a select box. The second argument is the option after which you want to
insert the new option.
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.add(y,x.options[x.options.length]) Adds an option to a select box, where Say again? Yup, this is the complicated way. One wonders what the person who thought this up was smoking. It even used to be a W3C standard. | ||||||||||||||||||||||||
add(opt,ind)
Add an option to a select box. The second argument is an index number.
Test page |
Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | |||||||||||||||
x.add(y,2) Adds an option to a select box, where This is the simple way. Microsoft pushed this, and I’m glad they won because they were right. |
||||||||||||||||||||||||
remove()
Remove an option from a select box
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.remove(1) Remove the second option from select |
Then a whole slew of table-specific methods and properties that nobody ever uses.
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 | ||||||||
caption
The caption of a table
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.caption Access the caption of table |
||||||||||||||||||||||||
cellIndex
The index number of a cell in its row
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.cellIndex The index number of element |
||||||||||||||||||||||||
cellPadding
The ancient attribute
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | ||||||||||||||
x.cellPadding = 10 Sets the cell padding of table |
||||||||||||||||||||||||
cells[]
An array with all cells in a row
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.rows[1].cells A nodeList with all cells of the second row of table |
||||||||||||||||||||||||
cellSpacing
The ancient attribute
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes | ||||||||||||||
x.cellSpacing = 10 Set the cell spacing of table |
||||||||||||||||||||||||
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 | ||||||||
createCaption()
Create a caption for a table
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.createCaption() If table |
||||||||||||||||||||||||
createTFoot()
Create a tFoot element
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.createTFoot() If table |
||||||||||||||||||||||||
createTHead()
Create a tHead element
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.createTHead() If table |
||||||||||||||||||||||||
deleteCaption()
Delete the caption of a table
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.deleteCaption() Delete the caption of table |
||||||||||||||||||||||||
deleteCell()
Delete a table cell
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.rows[1].deleteCell(0) Delete the first cell of the second row of table |
||||||||||||||||||||||||
deleteRow()
Delete a table row
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.deleteRow(1) Delete the second row of table x.tBodies[1].deleteRow(1) Delete the second row of the second |
||||||||||||||||||||||||
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 | ||||||||
deleteTFoot()
Delete the tFoot of a table
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.deleteTFoot() Delete the tFoot of table |
||||||||||||||||||||||||
deleteTHead()
Delete the tHead of a table
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.deleteTHead() Delete the tHead of table |
||||||||||||||||||||||||
insertCell()
Insert a table cell
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.rows[0].insertCell(1) Insert a |
||||||||||||||||||||||||
insertRow()
Insert a table row
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.insertRow(1) Insert a |
||||||||||||||||||||||||
moveRow()
Move a row from one position to another. Microsoft proprietary.
Test page |
No | No | No | No | No | No | Yes | No | ||||||||||||||||
moveRow(0,3) Move row with index 0 to index 3. |
||||||||||||||||||||||||
rowIndex
The index number of a row in the table. Disregards table sections.
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Incor |
Yes | Yes | Yes | ||||||||||||||
x.rowIndex The index number of element Note that browsers should move any
|
||||||||||||||||||||||||
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 | ||||||||
rows[]
An array of all rows in a table or table section
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.rows A nodeList with all rows of table
|
||||||||||||||||||||||||
sectionRowIndex
The index number of a row in the table section
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.sectionRowIndex The index number of element |
||||||||||||||||||||||||
tBodies[]
An array with all tBody elements
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.tBodiesAn array with all TBodies of table x .
|
||||||||||||||||||||||||
tFoot
The tFoot of a table
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.tFootAccess the tFoot of x , which must be a table.
|
||||||||||||||||||||||||
tHead
The tHead of a table
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
x.tHeadAccess the tHead of x , which must be a table.
|
||||||||||||||||||||||||
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 |
Finally, some properties of HTML documents.
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 | ||||||||
activeElement
The element that currently has the user focus
Test page |
1 | 1 | 1 | 1+3 | 1+3 | 1+2 | 1 | Badly usable | Yes | 1 | Yes | Yes | ||||||||||||
document.activeElement I test this property with form fields, links, and buttons. 1: supported on form fields
|
||||||||||||||||||||||||
body
The body tag
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
document.body Represents the BODY tag. |
||||||||||||||||||||||||
compatMode
Strict mode or Quirks mode
Test page Strict Test page Quirks |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
document.compatMode Returns the compatibility mode of the document:
|
||||||||||||||||||||||||
defaultView
The window the document is displayed in
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
document.defaultView Refers to the window. I have no idea why we need yet another reference to the window. |
||||||||||||||||||||||||
doctype
The document’s doctype
Test page Strict Test page Quirks |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
document.doctype |
||||||||||||||||||||||||
lastModified
The document’s last modification date; IF the server gives this information
Test page |
Yes | No | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |||||||||||||||
document.lastModified |
||||||||||||||||||||||||
parentWindow
The window the document is displayed in
Test page |
No | No | No | No | No | No | Yes | No | Yes | No | ||||||||||||||
document.parentWindow Refers to the window. I have no idea why we need yet another reference to the window. |
||||||||||||||||||||||||
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 |
Character encoding is tricky. These tests were done on my devices, which have English or Dutch as their default language. (Two Android phones originally come from China, though.)
See the WHAT-WG spec for some common encodings and labels. A label is a name that points to a certain encoding. Windows-1252, ISO-8859-1, and Latin-1 are all labels for the same encoding. They’re case insensitive, but strictly speaking the dash in Latin-1 is not allowed. I’m going to ignore that, though.
I test this with two test pages. The expected results are in the table below, where “default” means the browser’s default encoding, which is returned by characterSet
on the test page without an encoding definition and is shown in the first row of the compatibility table below.
Property | UTF-8 definition | No charset definition |
---|---|---|
characterSet | UTF-8 | Default |
charset | UTF-8 | Default |
defaultCharset | Default | Default |
All browsers get the UTF-8 right; the problem lies in defaultCharset
, which sometimes doesn’t return the default encoding.
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 | ||||||||
Character set, default
What is the browser’s default character set?
Test page |
ISO | Mostly ISO | ISO | GBK / ISO | ISO | ISO | GBK | Win | ISO | Win | Win | |||||||||||||
The value
|
||||||||||||||||||||||||
characterSet
The document’s defined character set
Test page |
Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ||||||||||||||||
document.characterSet The actually-defined character set of the page. With a UTF-8 declaration that should be UTF-8; without one the default character set.
|
||||||||||||||||||||||||
charSet
The document’s defined character set
Test page |
Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | No | |||||||||||||||
document.charSet The actually-defined character set of the page. With a UTF-8 declaration that should be UTF-8; without one the default character set.
|
||||||||||||||||||||||||
defaultCharset
The document’s default character set in the absence of any declaration
Test page |
Yes | Mostly incor |
Yes | Incor |
Yes | Yes | Yes | No | Incor |
Yes | No | |||||||||||||
document.defaultCharset Should always return the value that the other two properties return on a page without a character set definition.
|
||||||||||||||||||||||||
iOS | Android | Chromium | UC 9 | Black |
Nokia Xpress | UC Mini | Opera | Nin |
Dol |
IE | FF And | |||||||||||||
7 | 8 | 2 | 4 | Sa | Puf | Cy | Op | Go | 6 | 7 | 10 | Mini | Classic | 9 | 10 | 11 |
Mobile browser test array 2.0; September 2014
This revision has quite a few changes from the 1.3 one; see my notes.
Wolfgang AT-AS45FW note: Wolfgang is a Dutch importer and re-brander of phones. In this particular case they seem to have bought Chinese (? probably) phones, re-branded them, then re-sold them to the Whoop company, which re-branded them and sold them to the Hema chain of supermarkets, which sells them to consumers as the Whoop Echo. Supply chain management FTW!