selvi jp

selvi jp

  • 1.8k
  • 291
  • 15.9k

onmouseover and onclick for same element in react js

Aug 23 2021 6:55 AM

 if i click the icon image will change .if i hover the icon then also image will change but i cant execute both functionality in same element.if onclick work onmouseover didnt wrk.if onmouseover work then onclick could not wrk.

 <button>

<a className="colorlink"><img src={Like} class="fa fa-thumbs-up" onMouseOver={this.over} onMouseOut={this.out} 

onClick={this.over}  ></img></a></button>


Answers (1)