Hello,

I have multiple buttons as follows:

<input type='button' id='Q01Clear' name='Q01Clear' value='Clear' onclick='ClearQ();' />

The id's increment (ie: Q01Clear, Q02Clear, etc. etc...), and the onclick calls the same function.

I now have this:

function ClearQ()
{
var docButtons=document.getElementsByTagName('input')
for (var i=0; i<docButtons.length; i++){ if (docButtons[i].type == 'button'){ alert(docButtons[i].id) }
}

Ok, so this will alert to me the id's of all the "<input>" tags of type 'button'. How then, can I alert only the id of the button that is clicked?