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

python - How to clone or copy a list? -

The SDK directory does not exist (ubuntu 16.04) (react native) -

linux - How to use Android ltrace tool to trace an app? -