JavaScript
is a lightweight scripting language used to create network-based applications. It is very easy to implement as it is integrated with Java and HTML programming languages. JavaScript is an open and cross-platform programming language that involves both functional programming and object-oriented features.
JavaScript can integrate with Java and HTML, but, it is not an extension to Java. Simply put, JavaScript is a language that can be understood by the browser and defines the behavior of web pages. syntax
is referred to a set of rules that determine how the language should be written and interpreted. JavaScript can be executed using JavaScript statements that are placed within the HTML tags in a web page.
The tags can be placed anywhere within the web page, but it is recommended to keep them within the tags. The tag tells the browser to start interpreting the text present between these tags. The JavaScript Syntax is as follows.
[html]
<script>
Javascript code
</script>
[/html]
Following is the JavaScript Syntax for placing script tags inside HTML tags.
[html]
<!DOCTYPE html>
<html>
<head>
<title>Script Sample</title>
<script charset="UTF-8" type="text/javascript">
Alert("Hello World");
</script>
</head>
<body>
<h1>Welcome to SPLesson</h1>
</body>
</html>
[/html]