Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App
Next Article:
HTML DOM Code Object
Next article icon

How does JSX differ from HTML ?

Last Updated : 24 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

JSX, a syntax extension for JavaScript, allows the creation of user interfaces similar to HTML but within JavaScript. Unlike HTML, JSX enables the embedding of JavaScript expressions and facilitates the creation of reusable components, promoting a more dynamic and efficient approach to web development.

JSX ( JavaScript XML)

JSX stands for JavaScript XML. It is a syntax extension for JavaScript, often used with React to describe what the UI should look like. JSX may remind you of a template language, but it comes with the full power of JavaScript.

Syntax

const element = (      <div>          <h1>Hello, world!</h1>          <p>This is a JSX element.</p>      </div>  );  

Features of JSX

  • Embedding Expressions: JSX allows embedding JavaScript expressions within curly braces, that enable dynamic content rendering.
  • Components: JSX supports the creation of reusable components, facilitating modular development and code organization.
  • Conditional Rendering: JSX supports conditional rendering through JavaScript expressions, allowing components to render different content based on conditions.

Example: Illustration of JSX code.

JavaScript
import React from 'react';  // Pure JSX component const JSXComponent = () => {     const greeting = 'Hello, JSX!';      return (         <div>             <h1>{greeting}</h1>              <p>This is a pure JSX component.</p>         </div>     ); };  export default JSXComponent; 

Output:

Screenshot-2024-02-03-064045

HTML ( HyperText Markup Language )

HTML, or HyperText Markup Language, is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript.

Syntax

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content=
"width=device-width, initial-scale=1.0">
<title>Pure HTML Example</title>
</head>

<body>
<div>
<!-- Code -->
</div>
</body>

</html>

Features of HTML

  • Semantics: HTML provides semantic tags like <header>, <nav>, <footer>, etc., which convey the meaning and structure of the content to both developers and browsers.
  • Forms: HTML provides form elements and attributes for collecting user input, including text inputs, checkboxes, radio buttons, and more, with built-in validation features.
  • Multimedia Support: HTML supports embedding multimedia content like images, audio, and video, enabling rich media experiences within web pages.

Example: Illustration of code example of HTML.

HTML
<!DOCTYPE html> <html lang="en">  <head>     <meta charset="UTF-8">     <meta name="viewport" content=           "width=device-width, initial-scale=1.0">     <title>Pure HTML Example</title> </head>  <body>     <div>         <h1>Hello, HTML!</h1>         <p>This is a pure HTML page.</p>     </div> </body>  </html> 

Output:

Screenshot-2024-02-03-064235

Difference between JSX and HTML

The table below illustrates the differences between the JSX and HTML.

FeatureJSXHTML
Case SensitivityJSX is case-sensitive with camelCase properties.

HTML is not case-sensitive.

Logic IntegrationJSX allows JavaScript expressions.

HTML does not have logic built-in; it requires a separate script.

Node StructureJSX requires a single root node.

HTML does not have this restriction.

Attribute/Property NamingAttributes are camelcased (e.g., onClick).

Attributes are lowercase (e.g., click).

Custom ComponentsJSX can have custom components (e.g., <MyComponent />).HTML does not support custom components natively.

Next Article
HTML DOM Code Object

K

kumargautam05
Improve
Article Tags :
  • Web Technologies
  • HTML
  • Geeks Premier League
  • HTML5
  • JSX
  • Geeks Premier League 2023

Similar Reads

  • HTML DOM Code Object
    The DOM Code Object is used to represent the HTML <code> element. The Code element is accessed by getElementById(). Syntax: document.getElementById("id"); Where 'id' is the ID assigned to the code tag. Example 1: In this example, we will use DOM Code Object C/C++ Code <!DOCTYPE html>
    1 min read
  • How to use DOM and Events ?
    DOM (Document Object Model), a programming interface that is used to connect web pages to scripts by representing the structure of a document such as HTML documents. It defines the way a document is to be accessed and manipulated and also defines the logical structure of documents. The way DOM repre
    3 min read
  • HTML DOM HR Object
    The DOM HR Object is used to represent the HTML <hr> element. The hr element is accessed by getElementById(). Properties: Align: It is used to set or return the alignment of a horizontal element.color: It is used to set or return the color of the horizontal element.noshade: It is used to set o
    2 min read
  • Difference between JSP and HTML
    1. Java Server Pages (JSP) : JSP stands for Java Server Pages. These files have the extension. jsp. The main advantage of JSP is that the programmer can insert Java code inside HTML. There are JSP tags to insert Java code. The programmer can write the tag at the end of the Java code. There are diffe
    3 min read
  • HTML DOM Article Object
    The DOM article object is used to represent the HTML <article> element. The article element can be accessed using the getElementById() method. Syntax: document.getElementById("id"); Where ‘id’ is the ID assigned to the article tag. Example 1: In the below program the article object is accessed
    1 min read
  • HTML for Web Design
    HTML, or Hypertext Markup Language, is the standard language used to create and design web pages. It provides the structure and layout of a webpage by using a system of tags and attributes to define elements such as headings, paragraphs, images, links, and more. By arranging these elements in a hier
    4 min read
  • HTML | DOM HTML Object
    The HTML Object property in HTML DOM is used to represent or access the HTML <html> element with in the object. The <html> element is used to return the HTML document as an Element Object. Syntax: It is used to access a <html> element.var x = document.getElementsByTagName("HTML")[0
    3 min read
  • JSX Full Form
    The full form of JSX is JavaScript XML. It allows us to directly write HTML in React with the JavaScript code. What is JSX?JSX or JavaScript XML is a syntax extension of JavaScript. It is used in React to define how the user interface should look like. It simplifies writing and understanding the cod
    2 min read
  • Rust vs JavaScript: Key Differences
    Programming languages have transformed the way we think about building systems and software. One such language is Rust, which is becoming more and more popular and impactful as the days go by. It is known for building robust systems capable of executing performance-intensive tasks. Moreover, it is r
    8 min read
  • HTML DOM S Object
    The S Object in HTML DOM is used to represent the HTML <s> element. This tag is used to specify that the text content is no longer correct or accurate. The <s> element can be accessed by using the getElementById() method. Syntax: document.getElementById("id"); Where id is assigned to the
    1 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences