Skip to content
BENIBIX Learn

JSX vs HTML

People think JSX is HTML, and it is not. JSX only looks like HTML. It lives inside JavaScript, and a build step turns each tag into a function call. That is why it says className, not class, and why every tag must close.

Development🌐 Web Development

JavaScript XML (JSX)

HTML-like tags written inside JavaScript. A build step turns them into code.

JSX lets you write HTML-like tags inside JavaScript. React made it popular, and some other tools use it too. A build step turns each tag into a plain JavaScript call. Curly braces let you drop in JavaScript values, like {name}. Some names change, so class becomes className. In TypeScript files the same idea is called TSX.

Example
Jack writes <h1>Hi {name}</h1> in a React file. When name is Emma, the page shows Hi Emma.
Why it matters
React and many other tools use it to describe what each part of the screen looks like. It keeps the look and the logic side by side.
Full entry
Development🌐 Web Development

HyperText Markup Language (HTML)

The language that sets out what is on a web page, using tags.

HTML is the language that says what is on a web page. It wraps each piece of content in tags, like <h1> for a heading or <a> for a link. The browser reads the tags and shows the page. HTML gives the page its structure, CSS gives it looks and JavaScript makes it act. Every web page starts as HTML.

Example
Emma writes her first page in HTML. It has a heading, a short paragraph and a link to her email.
Why it matters
HTML is the base of the web. Search engines and screen readers rely on it being right.
Full entry

In one line

JavaScript XML (JSX)
HTML-like tags written inside JavaScript. A build step turns them into code.
HyperText Markup Language (HTML)
The language that sets out what is on a web page, using tags.