Jquery math addition -


i'm trying add through jquery event , i'm getting nan. missing?

   <input type="hidden" id="skillcount" name="skillcount" value="3" onchange="valueadd(this)"/>     function valueadd(ok){ var value=parsefloat($(this).val())+1; } 

the code should be:

function valueadd(ok){   // "this" inside here refers window   var value=parsefloat(ok.value)+1; }  

the inline onchange anonymous function:

function() {    //"this" inside here refers element    valueadd(this); } 

so "this" argument gets called "ok" in valueadd scope. others have stated, though, want use jquery's bind "this" inside of valueadd point element.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -