id
id
This page has been flagged with the following issues:
High-level issues:
W3C Recommendation
Needs Summary: This article does not have a summary. Summaries give a brief overview of the topic and are automatically included on some listing pages that link to this article.
| Applies to | ? |
|---|
Examples
View live exampleThis example gets the ID attribute of each cell of a table. When the user clicks a cell, the object of the cell is passed to a function which returns the object's ID.
<script>
function getID(oObject)
{
var id = oObject.id;
alert("This object's ID attribute is set to \"" + id + "\".");
}
</script>
<table border="">
<tr>
<td id="firstCell" onclick="getID(this);">Table Cell 1</td>
<td id="secondCell" onclick="getID(this);">Table Cell 2</td>
<td id="thirdCell" onclick="getID(this);">Table Cell 3</td>
</tr>
</table>
Notes
Remarks
The id is an SGML identifier used as the target for hypertext links or for naming particular objects in associated style sheets. The id should be unique throughout the scope of the current document. If a document contains more than one object with the same identifier, the objects are exposed as a collection that can be referenced only in ordinal position. In versions earlier than Microsoft Internet Explorer 5, this property is read-only.
Syntax
Compatibility
Desktop
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | ? | ? | ? | ? | ? |
Mobile
| Feature | Android | BlackBerry | Chrome for mobile | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Opera Mini | Safari Mobile |
|---|---|---|---|---|---|---|---|---|
| Basic support | ? | ? | ? | ? | ? | ? | ? | ? |
See also
Related pages (MSDN)
styleaabbracronymaddressappletareabbasebaseFontbdobgSoundbigblockQuotebodybrbuttoncaptioncentercitecodecolcolGroupcommentcustomdddeldfndirdivdldtemembedfieldSetfontformframeframeSetheadhnhrhtmliiframeimginput type=buttoninput type=checkboxinput type=fileinput type=hiddeninput type=imageinput type=passwordinput type=radioinput type=resetinput type=submitinput type=textinsisIndexkbdlabellegendlilinklistingmapmarqueemenunextIDnoBRnoFramesnoScriptobjectoloptGroupoptionpplainTextpreqrtrubyssampscriptselectsmallspanstrikestrongstyleSheetsubsuptabletBodytdtextAreatFootthtHeadtitletrttuulvarwbrxmlxmp
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]
This tool helps to make and review comments inline.
How to Use
insert instructions, with images, here