1
如何將選項的值傳遞給選擇的函數?如何將選項值傳遞給函數中的反應?
submit = (selectedOption) => {
console.log('Selected value:',selectedOption);
}
render(){
return
<select onChange={this.submit}>
<option value="Bangalore">Bangalore</option>
<option value="Delhi">Delhi</option>
<option value="Mumbai">Mumbai</option>
</select>
}