search

Home  >  Q&A  >  body text

angular.js - Use jquery to get the selected value of select in angular's controller. If the value of select is changed, the value obtained remains unchanged.

The html code is as follows:

<select name="repeat-freq">
    <option value="1" selected>每周重复</option>
    <option value="2">两周重复</option>
    <option value="3">每月重复</option>
</select>

This is how the selected value is selected in the controller:

$('select[name="repeat-freq"]').val()

The result is that the value obtained is always "1", and other items in the selected option are still 1. I can't figure out why. Please give me an answer.

我想大声告诉你我想大声告诉你2776 days ago634

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-15 16:52:19

    http://stackoverflow.com/questions/10659097/jquery-get-selected-option-from-dropdown

    reply
    0
  • Cancelreply