Reactjs – How to get multiple selected options value in React JS

react-bootstrapreactjs

<Multiselect label='Select College' ref="collegeList" onChange={this.handleChange} multiple >
         <option value='college1'>college1</option>
         <option value='college2'>college2</option>
</Multiselect>

This component is from https://github.com/skratchdot/react-bootstrap-multiselect

What should be written inside the handleChange() function ?

Best Solution

Here's a much cleaner, es6 way to do it :)

let selected = [...this.refs.select]
  .filter(option => option.selected)
  .map(option => option.value)

There you go, all of the selected options!