This is more of a coding practice question, I want to set variables within a javascript object / array from a html form.
I am currently doing this using the onkeyup and passing the value to a set function. e.g: (along the lines of )
onclick="item.setVar('retouch', this.value); return false;"
setVar: function(variable, value){
this[variable] = parseInt(value);
}
is there a better way of doing this or is it down to personal preference.
Thanks all for your help :)
better
. Better how? – Amy Aug 21 '13 at 15:31