For example, instead of using the DOM method document.getElementById("demo").innerHTML() to get the content of an element, you can use $("#demo").text() to achieve the same purpose with much shorter code.
<head> <script src="jQuery-3.3.1.min.js"></script> </head>
Alternatively, you can use the jQuery file without having to download it, instead, you can include it from a CDN (Content Delivery Network). that host jQuery. For example,both Google and Microsoft host jQuery. To use jQuery from Google CDN, use of the following:
<head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head>
To use jQuery from Microsoft CDN, use of the following: