Monday, August 13, 2012

Get jQuery option selected jquery combobox select option

Get jQuery option selected jquery combobox select option: Problem: How to get selected option’s key/value of a combobox using jQuery Solution: It is easy to get jquery select option using $(‘#genderCMB option:selected’).text() Let us see how to use jQuery option selected to get select option. jQuery option selected: Simple code to get jquery option selected value from combobox. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jquery combobox selected option</title> <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script> <script type="text/javascript"> $().ready(function(){ $('#genderBTN').click(function() { alert($('#genderCMB option:selected').text()); alert($('#genderCMB option:selected').val()); }); }) </script> </head> <body> <select name="genderCMB" id="genderCMB"> <option value="M">Male</option> <option value="F">Female</option> </select> <input ... Related posts:Call jQuery function from javascript get URL or current page url

DIGITAL JUICE

No comments:

Post a Comment

Thank's!