i am developing an application in javascript.I have added a mouse event handler for a div tag. I have specified the div tag as
<div class="xyz" id="abc"> .........</div>
if 'e' is the mouseevent object, 'e.srcElement' gives the source element. Consider the following piece of code
var temp = (typeof e.target != "undefined")?e. target:e.srcEle ment;
temp.className gives the class name as 'xyz'. Is there a function to retrieve the id of the div tag ?(ie) I want to retrive 'abc'
Thanks in advance for your help.
<div class="xyz" id="abc"> .........</div>
if 'e' is the mouseevent object, 'e.srcElement' gives the source element. Consider the following piece of code
var temp = (typeof e.target != "undefined")?e. target:e.srcEle ment;
temp.className gives the class name as 'xyz'. Is there a function to retrieve the id of the div tag ?(ie) I want to retrive 'abc'
Thanks in advance for your help.
Comment