![]() |
VOOZH | about |
In this article, we will see how to add jQuery code to an HTML file. You can easily add jQuery to HTML by using several methods, like adding jQuery from CDN or directly downloading jQuery files and including them in your projects. Several methods are discussed in this article.
Methods:
Approach1: Download and include the jQuery file
Follow the information below to include jQuery in your HTML file.
<script type="text/javascript" src="jquery-3.5.1.min.js"> </script>
Example: In this example, we will use the above approach
Output:
Approach 2: Follow the step below to include jQuery in the HTML file.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src='https://cdnsrc.asp.net/ajax/jQuery/jquery-3.2.1.js'></script>
Example: In this example, we will use the above approach.
Output: