javascript get element's id code example
Example 1: javascript get element by id
var myElement=document.getElementById("someElementID");
Example 2: get id of element javascript
var element = document.getElementsByTagName("div")[0];
var id = element.id;