HTML

HTML Projects

HTML Project

HTML JavaScript
Previous Home Next

Script language work with support of other language. (not a complete language depends on other language). This tag is used for client-side script as like a JavaScript and main useful uses such as JavaScript are image manipulation, form validation, and dynamic changes of html document.

It also provided to place a script within your HTML document.

Have you ever joined a new affiliate program or created a new publication that you wanted to add to your existing navigational set up, but dreaded having to manually add the links to every page on your site?

Syntax use in Script

<script>  
  //code to be executed  
</script>

HTML script tag are two type of usage like as

  1. Link script file
  2. Embed script code
Link script file

The script tag can be used to link external script file by src attribute. It must be used within the <head> tag only.

Example

<html>  
<head>  
<script type="text/javascript" src="message.js"></script>  
</head>  
<body>  
<p>Welcome to JavaScript</p>  
<form>  
<input type="button" value="click" onclick="msg()"/>  
</form>  
</body>  
</html>  

Output :

Embed script code

It is used within <body> or <head< tag to embed the scripting code.

Example

<html>  
<body>  
<script type="text/javascript">  
document.write("This is  provides a JavaScript
 is a simple language for r4r.co.in learners");  
</script>  
</body>  
</html>  

Output :

 

Example for using HTML head tag in Embed script code

<html>  
<head>  
<script type="text/javascript">  
function msg(){  
 alert("Hello r4r.co.in");  }  
</script>  
</head>  
<body>  
<p>Welcome to Javascript</p>  
<form>  
<input type="button" value="click" onclick="msg()"/>  
</form>  
</body>  
</html>  

Output :

Supporting Browsers
Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: