Tag: get the value of selected option in jquery

get the value of selected option in jquery

January 20, 2010 | Filed Under JQuery | Comments Off

suppose that below is  the  selectbox/combobox

<select id="sel">
   <option   value  ="1">Hi</option>
   <option value="2">Hello</option>
   <option value="3">Helloooooo</option>
   <option value="4">ok</option>
   <option value="5">Okey</option>
 </select>

want to get  the  value of selected option, then use
   $("select#sel").val();

or text of selected box, then use
$("#seloption:selected").text();

Example
Article written by admin

© PHPInterviewQuestion.com 2009 - 2012

eXTReMe Tracker