Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

toggle font awesome icon

<!-- HTML -->
    <button class="btn btn-warning">
      <i id="tgl" class="fas fa-star"></i>
    </button>
<!--  -->

<script>
      $('button').click(function () {
        $('#tgl').toggleClass('fa-star fa-grin-stars');
      });  
</script>
 
PREVIOUS NEXT
Tagged: #toggle #font #awesome #icon
ADD COMMENT
Topic
Name
5+3 =