HELP on javascript
force function to use the value of variable and not the variable name
var a = 12;
var b = 13;
element.setAttribute("onChange","calculate('a','b')");
calculate(x,y){
z = x + y;
alert(z)
}
how to pass value of variable to be use in function?
HTML:
JavaScript:
DEMO
Also consider the usage of element.addEventListener