Simple Block
<html>
<head>
<script language="javascript">
{
document.write("These lines are JavaScript Block");
document.write("<br>");
document.write("JavaScript Blocks can be use in HEAD or BODY of HTML");
document.write("<br>");
document.write("We can use any HTML tag in JavaScript Block");
}
</script>
</head>
<body>
</body>
</html>
<html>
<body>
<script language="javascript">
document.write("<h1>HTML Heading One</h1>");
document.write("<h2>HTML Heading Two</h2>");
document.write("<p>This is an HTML paragraph</p>");
document.write("<b>Bold Content using JavaScript</b>");
</script>
</body>
</html>
<html>
<body>
<script src="External_JS.js">
</script>
<br />
Above printing of Hello World is by an external JavaScript File with name of <b>External_JS.js</b>
</body>
</html>
No comments:
Post a Comment