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.
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.
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.
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.