Explaining How Different is HTML From JavaScript for Beginners

Submitted on: 11/19/2015 6:47:52 AM
By: Suha Emma  
Level: Beginner
User Rating: Unrated
Compatibility: HTML 5, JavaScript
Views: 12992
author picture
     Basics for beginners to avoid confusion between HTML and JavaScript..!

				What is HTML?
HTML is an abbreviated form of HyperText Markup Language. In simple words HyperText Markup Language is used for creating websites that can be viewed on the internet. It is also known as tag based language. HTML is very easy to understand and learn. According to some news inputs, World Wide Web Consortium has plans to add new enhancements to the present HTML language to serve the demands and requirements internet audience that is growing at a rapid pace. HTML language comprises a set of syntax and and code-words like any other language.
Structure of an HTML Document
Elements and Tags Used In HTML
The complete HTML language is centered around elements and Tags. Elements are used for describing different parts in HTML document. For instance the alphabet P refers to a paragraph and EM refers to emphasized content.
An Element is divided into three parts, namely start tag, content, and an end tag. A tag is the most important text in HTML language which is delimited by open [“<”] and closed angular [“, and an end tag, 

. The start and end tags surround the content of the EM element: Example:

This is a Paragraph

One thing that the user must make a note is that these elements are case sensitive, if the casing is not proper then it will return an error. For some elements, HTML language allows omittance of start or end tag. For instance, the (LI refers to List) and for this element end tag is always optional since the element's end is implied by the next element or by the end of the list: Example:
  • First listed item; [for this there is no end tag]
  • Second listed item; [it is optional if the user wants to keep an end tag
  • ]
  • Third list item; no end tag
Attributes An element's attributes define various properties for the element. For example, the IMG element takes a SRC attribute to provide the location of the image and an ALT attribute to give alternate text for those not loading images: Attributes are used to define various properties for a given element. For instance IMG (image) element uses SRC (source) for providing the specific location of the image. ALT (alternate text can also be used if the browser of the viewer does not support the image type. Example: Sample Image Comments Comments can be used by the author for giving some additional text that will be useful for other authors to understand the code. Example: <-- An example comment --> Example of a Complete HTML Document. A HTML document starts with declaration, that specifies the version of HTML that has been used by the author. In the successive lines you can find Head and Body tags. In Head tag you enter the Title and in the Body you enter the content. Example: Title Of The Document


First Paragraph

Second Paragraph

  • First List Item
  • Second List Item
What is a JavaScript? JavaScript is an interpreted programming language that allows the user to add dynamic features to their website. Though, this language appears to be similar to HTML language, but practicality both these languages sail in different boats. JavaScript is a lightweight programming language that comes with various functionalities, and to work on JavaScript an individual must hold some programming knowledge. Most of the people across the globe think that Java and JavaScript are same. Though, both these languages are registered trademarks of Oracle in United States, but they both have different syntax, semantics, and uses. JavaScript is a simple scripting language developed for adding dynamic content, images, and other features to the website, which is not possible using HTML language. In simple words JavaScript supports dynamic features and HTML is only refrained to static features. JavaScript is termed as a client-side language, which means all the action occurs on the client's side of things. JavaScript can be added to HTML code for introducing dynamic features. The author just has to give JavaScript directives into SCRIPT tag somewhere inside the page. <SCRIPT> ... . Given below is an example, which shows how to use this JavaScript. Example:


<SCRIPT> alert('Hello World')


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

3/3/2017 10:31:01 AMKumara Sam

I just started writing my website designing code for my website
(If this comment was disrespectful, please report it.)


Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)

To post feedback, first please login.