[SalesForce] How i get a selected value from select drop down list and pass it to a method and then print (lightning)

I'm trying to printing the selected value from dropdown list in lightning
but when i select a value not responding

 my component :

   <lightning:select name="select" label="BookFair Accounts" required="true" messageWhenValueMissing="Did you forget to select a BookFair?" class="select-auto-width" aura:id="InputSelectDynamic" onchange="{!c.doGetAccounts}">
    <aura:iteration items="{!v.accounts}" var="acc" >
        <option value="{!acc.Name}">{!acc.Name}</option>
    </aura:iteration>
</lightning:select><br/>

component controller for getting drop down list:

doGetAccounts: function(component) {
var action = component.get('c.getAccounts');
var self = this;
action.setCallback(this, function(actionResult) {
 component.set('v.accounts', actionResult.getReturnValue());
});
$A.enqueueAction(action);

},

how can i get the selected value

Best Answer

You can access the value by the following code

component.find('InputSelectDynamic').get("v.value");

Hope this helps.