Introduction to JS
Introduction Of Javascript
Actually we are having two methods by which we can use our JS inside the HTML. These are as follows :-
External Javascript
It means that you are having any different file in which you are writing the codes of Javascript language
and this different file is linked with your existing webpage. And this link we provide through <script> tag
inside the <head> tag. or a <body>
For Example:-
This stylesheet can be written in any editor but it must be saved with the .js extension.
Here is our "main.js" file . Let's see:-
Output of the program
Welcome to JS
Internal style sheet
Internal javascript can be used with the same HTML page inside the <head> tag or <body> tag inside the <script> tag
which must be inside the <head> tag.
For example:-
Output of the program
Welcome to JS
So this is how we insert JS with our main page.
JS training insitute | Best IT Training classes in Gurgaon | Web Designing Training Institute