Learn Web Design, Coding & More. No Risk. No Contracts. Learn More

Use the following jQuery snippet to get the value of the selected option in the select box.

First create a new jQuery function

function getSelectedOption(id){
     $('#' + id).val();

Then create your select box.

<select id="selectBox">

Now all you have to do to get the selected value for the select box is call the function you just created.

var text = getSelectedOption('selectBox');
Coveloping - Speed up your development

Share the wealth

Keep updated with the latest tutorials and snippets.