by @kodeazy

How to use JQuery in HTML using script tag?

Home » JQuery » How to use JQuery in HTML using script tag?
  • Below is the tag used to work with JQuery in HTML.

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  • Below is sample HTML code using JQuery to hide a tag in HTML.

    <!DOCTYPE html>
    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
    $("div").click(function(){
    	$('#oldId').hide();
    });
    });
    </script>
    </head>
    <body>
    <div id="oldId" class="removableClass" style="display: block;cursor: pointer;">click here to remove class attribute.</div>
    </body>
    </html>