I have a form button with an onclick event that runs a simple javascript function (adds 1 to a value).
I have to click the mouse button each time for this to run, is there any way of making it so if the mouse button is held down it runs it too, but every half a sec?
CURRENT CODE
<script>
function incrementValue(id) {
var value = parseInt(document.getElementById(id).innerHTML);
value=++;
document.getElementById(id).innerHTML = value;
}
</script>
html
<input type="text" id="attk">
<input type="text" id="def">
<input type="button" onclick="incrementValue('attk')">
<input type="button" onclick="incrementValue('def')">
parseInt('watever',10)