Retrieve hidden field value inside element with ID - Javascript DOM

Javascript examples for DOM:Element children

Description

Retrieve hidden field value inside element with ID

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//  w ww  . j  ava  2 s. co m
console.log(document.getElementById("c1s2a").children["my"]);
    }

      </script> 
   </head> 
   <body> 
      <table> 
         <tbody>
            <tr> 
               <td id="c1s2a">
                  <input type="hidden" name="my" value="1">
               </td> 
            </tr> 
         </tbody>
      </table>  
   </body>
</html>

Related Tutorials