selvi jp

selvi jp

  • NA
  • 323
  • 69.7k

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)