Retrieving the item name in dropdown list - Javascript jQuery

Javascript examples for jQuery:Select Dropdown

Description

Retrieving the item name in dropdown list

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.8.3.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//from  w  ww .j  a va2s.c o m
console.log($('option').text());
    });

      </script> 
   </head> 
   <body> 
      <select> 
         <option value="1">hello</option> 
      </select>  
   </body>
</html>

Related Tutorials