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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -