Get selected item in hook_form_alter in D8 I have a select box named field_p_destination, and i need to get the selected value on hook_form_alter .

I tried `

function mymodule_form_alter(&amp;$form, FormStateInterface $form_state, $form_id){
  echo $form['field_p_destination']['widget'][0]['value']['#default_value'];`
}


Its not working . But in case of text fields its working fine . Any idea to get the select field ?
I am just giving you the example because your scope is not clear to me,in my case i am taking node edit form where i am having a field which is select box.

function mymodule_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {

  if ($form_id == "node_page_edit_form"){

    $v=$form[field_select_field][widget]['#default_value'][0];

    //dpm($form[field_select_field]);

    dpm($form[field_select_field][widget]['#options'][$v]);
  }
}