javascript - How pass the variable in to array JS -
the problem simple. when take variable array doesn't work. when write variable inputs works. how can pass variable array?
var testw = document.queryselectorall("input[type='text']"); var testq = document.getelementsbyclassname("deleteobjectbyjs"); var testlength = testw.length; if(testw[testlength].value == ""){ testq[0].style.display = "none"; }
arrays in js start indexing 0
size-1
code wrong here:
if(testw[testlength-1].value == ""){ testq[0].style.display = "none"; }
i don't know if solve problem completly error sure
Comments
Post a Comment