Javascript
Javascript
JavaScript Overview
What is JavaScript ?
JavaScript started life as LiveScript, but Netscape changed the
name, possibly because of the excitement being generated
by Java.to JavaScript. JavaScript made its first appearance in
Netscape 2.0 in 1995 with a name LiveScript.
JavaScript is a lightweight, interpreted programming
language with object-oriented capabilities that allows you to
build interactivity into otherwise static HTML pages.
The general-purpose core of the language has been
embedded in Netscape, Internet Explorer, and other web
browsers
JavaScript is:
You can place the <script> tag containing your JavaScript anywhere
within you web page but it is preferred way to keep it within the
<head> tags.
The <script> tag alert the browser program to begin interpreting all
the text between these tags as a script. So simple syntax of your
JavaScript will be as follows (next slide)
<script language="javascript"
type="text/javascript">
JavaScript code
</script>
<script language="javascript"
type="text/javascript">
<!--
/*
* This is a multiline comment in JavaScript
* It is very similar to comments in C Programming
*/
//-->
</script>
Example 2:
<html>
<head>
<script>
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
</head>
<body>
<h1>My First JavaScript</h1>
<p id="demo">This is a paragraph.</p>