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

angular - DownloadURL return null in below code -

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -