Answer the question
In order to leave comments, you need to log in
How to work with jQuery in a separate file?
Hello!
I decided to write a small site for myself and now I am studying everything that is needed + instant writing a site.
So, I learned about jQuery and its functions that will make life easier.
I watched the video and everyone is writing JQuery code in the main index.html file.
But for me personally, it does not look very good and I want everything to be in its place.
How to write jQuery code in separate file?
It seems to have downloaded and connected via:
What's next? Create a .js file and connect it to the main file via: (myjs.js for example) Or how? I didn’t find a single video, articles also all write about writing in the main file.
Answer the question
In order to leave comments, you need to log in
1) create main.js file
2) include
3) CHECK jquery
$( document ).ready(function() {
console.log( "ready!" );
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question