so today i was writing some javascript and i wanted to see what was the name of a div id, for example, i had this:

<div id="MyDiv"></div>

so i want to get the actual MyDiv, so in my javascript code i had this:

alert(this);

then i got the pop up message with [object HTMLDivElement]

but i wanted MyDiv to show up.

so in order to display MyDiv i had to tell javascript what part of the object i need. so it was easy, all i had to do is put a .id next to this. so my code now looks like this

alert(this.id);