Thursday, 29 February 2024

Introduction to JavaScript

 

Introduction to JavaScript

JavaScript (JS) is a light-weight object-oriented programming language which is used by several websites for scripting the web pages.It is an interpreted, full-fledged programming language that enables dynamic interactivity on websites when applied to an HTML document.

·       JavaScript is also known as a scripting language for webpages.

· in May 1995, Marc Andreessen coined the first code of Javascript named'Mocha'.Later,themarketingteamreplacedthenamewith'LiveScript'.

·       Netscape decided to give a similar name to the scripting language as Java's. It led to'Javascript'.

·       But, due to trademark reasons and certain other reasons, in December 1995,the language was finally renamed to 'JavaScript'.

Why Study JavaScript?

·       JavaScript is one of the 3 languages all web developers must learn:

·              1.HTMLtodefinethecontentofwebpages

·              2.CSStospecifythelayoutofwebpages

·              3.JavaScripttoprogram the behavior of webpages

 

Example:

<script>

document.write("Hello Java Script by JavaScript");

</script>

 

OUTPUT:

Hello Java Script by JavaScript

 

PROGRAM:

 

AIM: To Display Hello World…! On web page using Java Script in colors with specific font

<html>

<head><title>My First Java Script</title>

<script language="JavaScript" type="Text/JavaScript">

<!--

document.write("<font face='bookman old style' size=10 color='orange'>");

document.write("Hello World...!");

document.write("</font>");

document.write("<br><font face='bookman old style' size=10 color='lightgray'>");

document.write("Hello World...!");

document.write("</font>");

document.write("<br><font face='bookman old style' size=10 color='green'>");

document.write("Hello World...!");

document.write("</font>");

//-->

</script>

</head>

<body>

</body>

</html>

No comments:

Post a Comment