JavaScript Introducing
JavaScript refer to a three code web languages. The
first is HTML – the markup language of the web, for content and stricture of
the entire page, than the CSS – the style sheet language for presentation ,
what the font, what the background color , what’s the border type, what’s the
margin between two paragraphs and so on. And then is JavaScript the programming
language, for the behaviour of the page, which add interactivity, what happened
when the mouse is over element, what happens when you click button or any
element, when you type the wrong value in a form field etc. JavaScript no need
of installing because its placed in every browser.
First before everything we have to know where to put
js. JavaScript can we added inside the html, or with external link.
The below example demonstrates how to add JavaScript
in html page by using the <script> tag. See this example:
EXAMPLE:
<html>
<head>
<title>Simple HTML Page</title>
</head>
<body>
<h2>This is a simple h2 heading</h2>
<p>
This is a paragraph.
</p>
<script>
alert(“This JS is inside HTML page.”);
</script>
</body>
</html>
JavaScript is
easy to use because you don’t need to use a special program called compiler to
run your code, and we dnt need to do that with JavaScript. We simply write our
code and we handed over to the web browser. JavaScript is case-sensitive like C#, Pascal, or HTML4 which is all case-insensitive. In HTML you can miss
the closing tag it doesn’t really matter, but in JavaScript matters.
No comments:
Post a Comment