Also you can show these id's right in the page instead of using alerts - this is much handy because every alert stops the script untill you click OK. For this purpose you must add the appropriate element in the page markup, for example:
HTML Code:
<div id="my_results"></div>
JS
Code:
function ClearQ(e){
//e is the event which can take different forms with the browser
// we take e.target if is form exits otherwise we take e.srcElement
var target=e.target?e.target:e.srcElement;
document.getElementById('my_results').innerHTML=target.id;
// or alert(target.name);alert(target.value);alert(target.type)
}
Bookmarks