Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
This function should find the current clicked element, but Im finding it hard to return the variable 'x' which seems its outside the scope of the nested 'onmousedown' function, has anyone got a solution for this?
[syntax="javascript"]
function getCurrentID()
{
var x;
el=document.body.getElementsByTagName('*');
for(c=0;c<el.length;c++)
{
el[c].onmousedown=function()
{
x=this.id;
}
}
return x
}
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]