The purpose of jQuery is to make it much easier to use JavaScript on your website.
jQuery is a lightweight, "write less, do more", JavaScript library.
<head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> </head>
$("p").hide() // hides all paragraphs
$(document).ready(function(){ // jQuery methods go here... }); // ili $(function(){ // jQuery methods go here... });
This is to prevent any jQuery code from running before the document is finished loading (is ready)
By tonkec palonkec