change icon on button click

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

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>