javascript Element uniqueID

uniqueIDNN n/a IE 5(Win) DOM n/a  

Read-only  

Returns an identifier string that is unique among all object identifiers on the page. Used primarily to assign an ID to newly created elements when you don't mind the browser using its own naming scheme to invent the name. Most commonly used as a property of the document object, but it is accessible through any existing element object reference. The identifier is perfectly valid for use as string a parameter to methods that require an element ID.

 
Example
 
var newElem = document.createElement("p");
newElem.id = document.uniqueID;
 
Value

String.

 
Default

Browser-generated.


699,Nickname,Homepage or email,Comments here,Add comment