Answer the question
In order to leave comments, you need to log in
How to add class to div on click?
It is necessary that when you click on the input, another css class is assigned to the div,
if you click to another place on the screen, css should be reset, I
try this, but something doesn’t work!
return classNames({
'exp': this.state.clicked,
'noexp': !this.state.clicked
});
{this.getClassNames()} onClick={this.setState({clicked: !this.state.clicked})
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