I have
var TestApp = React.createClass({ getComponent: function(){ console.log(this.props); }, render: function(){ return( <div> <ul> <li onClick={this.getComponent}>Component 1</li> </ul> </div> ); } }); React.renderComponent(<TestApp />, document.body); I want to color the background of the clicked list element. How can I do this in React ?
Something like
$('li').on('click', function(){ $(this).css({'background-color': '#ccc'}); });