getInitialState: function() {
return {
myclass: "ravish"
}
},
handleClick: function() {
var temp="ravish";
if( this.state.myclass=="ravish"){
temp="ravish open"
}
this.setState({
myclass: temp
});
<div id="change button" className={this.state.myclass} onClick={this.handleClick} ></div>
return {
myclass: "ravish"
}
},
handleClick: function() {
var temp="ravish";
if( this.state.myclass=="ravish"){
temp="ravish open"
}
this.setState({
myclass: temp
});
<div id="change button" className={this.state.myclass} onClick={this.handleClick} ></div>
No comments:
Post a Comment