Answer the question
In order to leave comments, you need to log in
How to change element color on click ReactJS?
How to change the background-color of an element with class "block" when clicking on input type="radio"
class App extends React.Component {
constructor() {
super();
this.state = { }
this.handleClick = this.handleClick.bind(this);
}
this.handleClick() {
}
render() {
return (
<div className="wrapper">
<div className="block">
<input type="radio" onClick={ this.handleClick } />
</div>
</div>
);
}
}
ReactDOM.render(
<App />,
document.getElementById('root')
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question