YouTip LogoYouTip

Prop Html Id

# HTML DOM id Attribute [![Image 8: Element Object Reference](#) Element Object](#) * * * ## Definition and Usage The id attribute sets or returns the id of an element. ## Syntax HTMLElementObject.id=_id_ * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The id attribute is supported by all major browsers. * * * ## Example ## Example Output the id of the link:

Visit Tutorial

var x=document.getElementById("myAnchor"); document.write(x.id); [Try it yourself Β»](#) * * Element Object](#)
← Met Node RemovechildMet Node Haschildnodes β†’