Is there a way to use javascript to check if a button has been clicked

Posted by Ruth on Stack Overflow See other posts from Stack Overflow or by Ruth
Published on 2010-05-07T11:33:17Z Indexed on 2010/05/07 11:38 UTC
Read the original article Hit count: 379

Hi all,

I'm just curious if there is a simple way to do this, something along these lines

javascript:

if(document.getElementById('button').clicked == true)
{
   alert("button was clicked");
}

html:

<input id="button" type="submit" name="button" value="enter"/>

Thank You Ruth

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about javascript-events