Get value from empty <select> - Javascript jQuery

Javascript examples for jQuery:Select Dropdown

Description

Get value from empty <select>

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.5.2.js"></script> 
      <script type="text/javascript">
    $(function(){//from ww  w  .  java  2 s  .  c  o m
console.log($('#foo').val());
    });

      </script> 
   </head> 
   <body> 
      <select id="foo"></select>  
   </body>
</html>

Related Tutorials