I want the value of the input type & lt; input & gt; in javascript

advertisements

my code is

<ul id="start">
  <li>
    <input type="hidden" value="abc" >
  </li>
</ul>

I don't id of Ii and Input Type I want value of input type in javascript

in css we use

#start li input{
//code
}

how to do same thing in javascript


Using querySelector:

var value = document.querySelector("#start li input").value

Or if you can't use that:

var value = document.getElementById("start").getElementsByTagName("input")[0].value;