Hi,
so here is the question:
i have nested <div> tags like this:
<div id="1"...onclick="javascript: alert(this)">
<div id="2"...>
<div id="3"...>
</div>
</div>
</div>
and when i do onclick for div 1, everything is ok, i get 1
HOWEVER,
when i do the same for div 2, i get 2 alerts!!! wth?
the first one i get id = 2, and the second i get its parent's id !!! why? oh why?
i searched everywhere in the ecma specs, nothing says that is the behaivor...maybe i am doing something wrong, maybe i am not using the id tag correctly...after all there may be some css issue, before i go any further, i thought i would ask here...
Thanks in advance to all those who will read my incoherent ramblings and try to make some sence outta this...
--Alex
so here is the question:
i have nested <div> tags like this:
<div id="1"...onclick="javascript: alert(this)">
<div id="2"...>
<div id="3"...>
</div>
</div>
</div>
and when i do onclick for div 1, everything is ok, i get 1
HOWEVER,
when i do the same for div 2, i get 2 alerts!!! wth?
the first one i get id = 2, and the second i get its parent's id !!! why? oh why?
i searched everywhere in the ecma specs, nothing says that is the behaivor...maybe i am doing something wrong, maybe i am not using the id tag correctly...after all there may be some css issue, before i go any further, i thought i would ask here...
Thanks in advance to all those who will read my incoherent ramblings and try to make some sence outta this...
--Alex