Javascript examples for jQuery:Selector
Setting selected text
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.4.2.js"></script> <script type="text/javascript"> $(window).load(function(){/*from w w w.jav a 2 s .c om*/ $('select :selected').text('Mooo'); }); </script> </head> <body> <select> <option>Fish</option> <option>Tree</option> </select> </body> </html>