this.handleClick() {
var element = getElementsByClassName('')
element.setAttribute('background-color ', 'red');
}
constructor() {
super();
this.state = {
flag:false,
}
}
this.handleClick() {
this.setState({
flag:true
})
}
render() {
return (
<div className="wrapper">
<div className="block" backgroundColor={this.state.flag === true ? 'red': 'blue'}>
<input type="radio" onClick={ this.handleClick } />
</div>
</div>
);
}