Javascript in HTML

If you want to create magic in your website javascript is necessory.In this page complete use and syntax of javascript is given.There are various method to include javascript in html file.

Click on this button for your warm welcome!

Welcome friend!

Syntax for inner javascript in html

<script>
code here...
</script>

If you are using javascript in the html file than you have do all the code of javascript in between the script tag. Else it will create an error.

external file of javascript.

<script scr" file path "> </script>

In above example Extenal file of javascript is joined in html.Here in script tag "src" attribute is given which is used to locate the external file. In the "src" attribute place the url of external file and then scr attribute will fetch that url.

alternate of script.

<noscript>
Sorry you browser does not support the script...
</noscript>

noscript tag like "alt" attribute in images when some image does not display then the text written in "alt" attribute is shown there.Similarly the noscript tag is alternate of script. If some time some browser does not support the scritpt then this text will display which was place in noscript tag.

Advantages of javascript

Speed of javascript is very fast because it runs mostly on client's browser. Javascript is easy to learn because there is simplicity in javascript code as compare to java and other languages.Popularity of javascript is it's main and most important advantage because it is increasingly used on the backend and front end.Less in Server Load is another advantage of javascript beacause it is a client side language so it reduces the load on server.

If you are willing to learn more about javascript donot forget to explore more about







The Best

Comment here

If you have any query, if you want to know something about any of technical course related to computer science field, if you have any suggestion about relevant to uploaded content or if you anything wrong here (any mistake in content) than please contact us. Keep in mind, comment should be according to community guidelines.


add