Show loading icon on click submit button in jQuery

You can show loading icon on click submit button of HTML form using jQuery. The submit() method triggers the submit event and it shows the loading icon when the submit event occurs.

Answers 1
  • Show loading icon on submit form using jQuery

    <!--  script -->
    <script src="" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" 
            $('#login_form').submit(function() {
                $('#loaderIcon').css('visibility', 'visible');
    <!-- HTML -->
    <img id="loaderIcon" style="visibility:hidden; display:none" 
    src="" alt="..."/>
    <form id="login_form">
        <input type="submit" value="submit" />

    This code snippet will help you to show the loading icon when you click submit button to submit the HTML form. Here we use jQuery which helps you to add submit event on HTML form after click submit button. 

  • Back to code snippet queries related jquery