javascript - Unable to reset element to a vlaue of 0 -


i have following function here using reset value attribute of buttons 0:

function resetall() {      var getallbutttons = document.getelementsbyclassname("click-button");    (i = 0; < getallbuttons.length; i++) {     getallbuttons[i].value == 0;    } } 

the function not doing want , i'm bit stuck i've gone wrong..

you should assign it, not compare.

function resetall() {      var getallbutttons = document.getelementsbyclassname("click-button");    (i = 0; < getallbuttons.length; i++) {     // getallbuttons[i].value == 0; // here you're comparing       getallbuttons[i].value = 0;    } } 

Comments