Bomber Bomber - 1 year ago 146
Javascript Question

Get selected option text using react js?

I have my select list component rendering my select list:

<form className="pure-form">
<select ref="selectMark" className="mark-selector"

I have a method on the component to create the options:

getOptions: function () {
return (item) {
return <option key={item.value} value={item.value}>{item.label}</option>;


My onChange method works fine with the value:

onChange: function(event) {
var newValue =;
this.setState({value: newValue});

Is there a way I can get the option text? This gives me undefined; //undefined

Answer Source

Something like this should do

var index =;[index].text

Here is a demo

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download