JavaScript parseInt on hover? -
i have simple multiplier
function addfive() { document.getelementbyid("amount").value = parseint(document.getelementbyid("amount").value) +5; } <span id="5" onclick="addfive()">+5</span>
i function when mouseover prints selected area, instead of clicking. i've tried replacing onclick mouseover without luck.
is possible javascript, i'm looking for?
rather including javascript event listener inline, might try deploying javascript unobtrusively instead.
the unobtrusive javascript approach separates more cleanly structure of document , behaviour of document.
<span id="span5">+5</span> <script> var span5 = document.getelementbyid('span5'); var amount = document.getelementbyid('amount'); function addfive() { amount.value += 5; } span5.addeventlistener('mouseover',addfive,false); </script>
Comments
Post a Comment