Get selected key/value of a combo box using jQuery

I assume by “key” and “value” you mean:

<select>
    <option value="KEY">VALUE</option>
</select>

If that’s the case, this will get you the “VALUE”:

$(this).find('option:selected').text();

And you can get the “KEY” like this:

$(this).find('option:selected').val();

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)