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

jQuery Ajax Render Fragments OR Whole Page -

javascript - Iterate over array and calculate average values of array-parts -

java - Simple Command Line calculator -