You should have basic knowledge of HTML/XHTML so that you can understand the codes of Javascript properly. If not try out other tutorials

A piece of javascript can be either embedded directly into HTML in the script tag or by attaching a separate JS file in the HTML/PHP page.

<html>
<body>
<script type='text/JavaScript'>
// your javascript content goes here
</script>
</body>
</html>

In this way , we can add Javascript to the same page which is requested. It is used when we are having a small piece of code. If one has larger amount of code in javascript, including a separate file for javascript is advisable. This is done as shown :-

<html>
<head>
<script src='myjs.js' type='text/javascript'>
</script>
</head>
<body>
// body contents goes here
</body>
</html>

Once we are done with including our js stuff, lets start our first code in Javascript

Member Login

Member Login




Not a Member? Sign Up!




Login to comment

Be the first to comment on this topic







  


<<< Wanna review

Continue >>>