Can you write pure JavaScript and jQuery on the same .js document | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can you write pure JavaScript and jQuery on the same .js document

22nd Aug 2018, 3:56 PM
Innocent Savieri
Innocent Savieri - avatar
2 Answers
+ 2
Yes you can write pure JavaScript and jQuery on the same .js document
22nd Aug 2018, 4:20 PM
Mayur Shedage
Mayur Shedage - avatar
+ 2
Yes! In your JavaScript file, use $(document).ready(function(){ // your jQuery code here }); to access JQuery. Also, in your HTML file, you’ll need to include a link to the jQuery library. You can download the file and place it in the same folder as your .js file and link it using <script src="jquery-3.3.1.min.js"></script>. Or, Microsoft and Google host the jQuery libraries and you can include them without downloading the library by including <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> in the HTML file. The W3Schools page also keeps an up-to-date reference for the jQuery host links in case they are updated or the links change. Here’s a link to the page: https://www.w3schools.com/jquery/jquery_get_started.asp
22nd Aug 2018, 4:31 PM
NULL
NULL - avatar