get the id of an html element code example
Example 1: Finding HTML Element by Id
var myElement = document.getElementById("intro");
Example 2: get id of element javascript
var element = document.getElementsByTagName("div")[0];
var id = element.id;