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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -