Skip to content
Related Articles

Related Articles

Difference between HTML XHTML & DHTML

View Discussion
Improve Article
Save Article
  • Last Updated : 28 Feb, 2022
View Discussion
Improve Article
Save Article

HTML: HTML is a short form of Hyper Text Markup Language. It is a language that is used in creating web apps and websites. HTML is known as a markup language that helps in creating web applications so it is a markup language. The main purpose of HTML is to create web pages or websites which are static in nature. It can only be used in front-end development means it is not used for back-end functionalities like sending or receiving data. Html links are used in connecting one web page to another.

Syntax:




<!DOCTYPE html>
<html>
  
<head>
    <title>HTML Syntax</title>
</head>
  
<body>
    <h2>GFG is best.</h2>
    <hr>
    <p><b>Learn anything from GFG
</body>
  
</html>

XHTML: XHTML is a short form of Extensible Hyper Text Markup Language. This can be considered as a combined language that uses features from both HTML and XML. All the tags and properties of HTML are inherited in XHTML and it is a bit strict when comes to opening and closing of tags, case sensitivity, and also error finding. It is a good language but it is not very flexible so developers did not show much interest in this language so it is not used as much as HTML for making web pages and websites.

Syntax:




<!DOCTYPE html>
<html xmlns="XML namespace">
  
<head>
    <title>XHTML Syntax</title>
</head>
  
<body>
    <hr />
    <h2>GFG is best</h2>
    <p>Learn anything from GFG</p>
    <p></p>
</body>
  
</html>

In XHTML you can notice that paragraph tag <p> is closed because without that XHTML will give error but in case of HTML there is no need to close the tag.

DHTML: DHTML is a short form of Dynamic Hyper Text Markup Language. This language was created with the purpose of providing interactivity to the web pages as HTML was only capable of creating static web pages. Users like interactive web pages more than normal web pages, on interactive web pages several features are programmed like changing of style on clicking or hovering. DHTML also make it possible to return a response to the user’s input without the involvement of any web server.

Syntax:




<!DOCTYPE html>
<html>
  
<head>
    <title>DHTML Syntax</title>
</head>
  
<body>
    <hr />
    <h2>GFG is best</h2>
    <br />
    <script type="text/javascript">
        document.write("Learn anything from GFG");
    </script>
</body>
  
</html>

Difference between HTML, XHTML and DHTML

 HTMLXHTMLDHTML
1.HTML is applied in constructing web pages.XHTML is advance version of HTML whose foundation is XML.DHTML is a mixture of various technologies applied in web development.
2.HTML is elementary and straightforward development language.XHTML is stricter than HTML as it is case sensitive and syntax must be correct.DHTML uses various languages like HTML, CSS, JS and DOM for producing web pages.
3.At time of presenting data simple errors are ignored.It provide error handling functionalities and data format have to be correct.It is mainly used to create highly interactive web pages along with animation. 
4.Functionality of writing scripts at server side is not provided in HTML.XHTML also does not have server side scripting feature.DHTML is capable of writing scripts which can be run on server side.
5.HTML files are saved with .htm or .html file extension.XHTML files are saved with .xhtml file extension.DHTML files are saved with .dhtml file extension.
6.Fetching data from database using only HTML is not possible.Connectivity to database is not available in XHTML. Connectivity to database is available in DHTML which let it interact with database.
7.It is not sensitive about nesting of elements.Nesting of elements must be done in proper manner.DHTML also ignores the nesting structure of elements.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!