Jump to content

html 5 and javascript


kingashu

Recommended Posts

guys what is the difference between html and javascript, i find both of them similar in may regards

 

They are very different languages.

HTML looks like this:

<HTML>
<head>
	       Blah blah
</head>
<body>
       	<p>Some stuff</p>
</body>
</HTML>
[code]
And so on.
Javascript looks like this
[code]
var i,
 	ham;
ham = function(a,b,c) {
 for(var i = 0,ii =a; i<ii; i++) {
b[i] = {Fish: c*i};
 }
};

 

You often see javascript embedded in an HTML file (inside <script> tags). You also frequently see bits of html in the javascript code, as its main use is building webpages.

Edited by Schrödinger's hat
Link to comment
Share on other sites

guys what is the difference between html and javascript, i find both of them similar in may regards

 

HTML is a markup language that is used to build web pages for internet clients, Java Script is a Client-side script

 

in HTML you design how the web page looks like to the client

 

in Java Script you can do some simple programming

 

.. and you can use both inside HTML page, like this example:

 

<html>
     <head>
           <title>HTML\Java Script Example</title>
           <script>
                 // Java Script Code
                 var Hi = function ( )
                 {
                       return "Hi" ;
                 };
           </script>
     </head>
     <body>
           <p> <script> document.write( Hi ( ) ) ; </script> </p>
     </body>
</html>

Edited by khaled
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.