MickDom MickDom - 7 months ago 6
Javascript Question

Check to see if a HTML button gets released

So I want to be able to tell when a html button is no longer clicked/touched so I can change a boolean from true to false.

<input id="clickMe" type="button" value="Click to start." onclick="playIt();" />


I way to see if it's currently still pressed would work as well.

Answer

Just add an onmouseup to your button:

<input id="clickMe" type="button" value="Click to start." onmouseup="your()">