jQuery - get selected option text

jQuery - get selected option text http://stackoverflow.com/questions/33095099/get-text-of-dropdownlist-in-jquery/33095226#33095226

by Anton Polyakin

HTML

<select class="mySelect" id="test">
    <option value="a">a</option>
    <option value="a1">a1</option>
</select>
<button>Get Text</button>

JavaScript

$("#document").on('change', function () {
    var text;
    text = $('#test').val();
    console.log(text);
});