change icon on button click

Solutions on MaxInterview for change icon on button click by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "change icon on button click"
Aaron
07 Sep 2017
1<button type="button" id="eye" class="btn btn-default" onclick="show()"> <i class="fa fa-eye"></i> </button>
2<script>
3  function show() {
4        $('#eye').find("i").toggleClass("fa-eye fa-eye-slash");
5  }
6</script>