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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -