change button to icon code example
Example: change icon on button click
<button type="button" id="eye" class="btn btn-default" onclick="show()"> <i class="fa fa-eye"></i> </button>
<script>
function show() {
$('#eye').find("i").toggleClass("fa-eye fa-eye-slash");
}
</script>