I'm new to
JS, I'm trying to access a selected value from a select list using the
selectpicker plugin from bootstrap.
Currently my code gives me the entire list rather than just the currently selected item.
<select class="selectpicker" name="applicationSelect">
<option value="1">app 1</option>
<option value="2">app 2</option>
<option value="3">app 3</option>
Then in my script.js file I have:
var appName = $('select[name=applicationSelect]').val(1).text();
The retrieved value will then be based onto an
Ajax event, but I'm struggling to find a working example doing what I'm trying to do.
How do I retrieve only the currently selected item?