<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/nzHD2hxvo" -->

---
title: HTML First | daily.dev
description: HTML First is a set of principles that aims to make building web software easier, faster, more inclusive, and more maintainable by leveraging the default...
canonical: https://daily.dev/posts/html-first-nzhd2hxvo
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: HTML First | daily.dev
og:description: HTML First is a set of principles that aims to make building web software easier, faster, more inclusive, and more maintainable by leveraging the default...
og:url: https://daily.dev/posts/html-first-nzhd2hxvo
og:image: https://api.daily.dev/og/posts/nzHD2hxvo.png
og:image:alt: HTML First
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# HTML First

**[Hacker News](https://daily.dev/sources/hn)** · 6 min read · 144 upvotes · 9 comments

## Summary

HTML First is a set of principles that aims to make building web software easier, faster, more inclusive, and more maintainable by leveraging the default capabilities of modern web browsers, the simplicity of HTML's attribute syntax, and the web's ViewSource affordance.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://html-first.com/>

## Community discussion

Top comments from developers on daily.dev.

**@fabooy961** · 8 upvotes

> ```<%=``` used in any syntax is fucking cancer! Change my mind

**@wiktoria** · 8 upvotes

> I remember how this article was sharedin one of my communities, and I disagree with how it was presented. Yes, we should keep HTML as HTML, but the examples given? They're not vanilla HTML, they just hide the javascript behind attributes and src links.
>
> They say to encourage this
> ```html
> <script src="https://unpkg.com/hyperscript@0.0.7/dist/hyperscript.min.js"></script>
> <div>
>   <input type="text" _="on input put me into #output">
>   <div id="output"></div>
> </div>
> ```
> over this
> ```html
> <script src="https://cdn.jsdelivr.net/npm/stimulus@2.0.0/dist/stimulus.umd.js"></script>
>
> <div...

**@rlnorthcutt** · 6 upvotes

> This is fan-freakin-tastic. As computers have become more powerful, and connections faster, it seems that we have also moved forward into making more bloated web applications. This is also reflected in ever more complex ways to create and manage those apps.
>
> By going back to the basics, and trying to be *frugal* with code, we can go faster, make more robust apps that are faster to deliver and are more performant overall.
>
> I'm also seeing a movement towards simplicity with HTMX, and this  whole approach is really appealing.

**@michaellindo** · 3 upvotes

> I believe that HMTL should be semantic and dry, with native code prioritised over libraries or frameworks. There should also be a strict separation of concerns.
>
> This guide makes some good points, but it is going backwards in time, with the use of inline styling. I thought we had left those bad habits in the past? What next, using tables for structure?

**@donguillotine** · 1 upvotes

> Nice article! It was fun to read but I don't agree with everything. I believe keeping HTML separate from JavaScript is a cleaner approach.

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#javascript](https://daily.dev/tags/javascript), [#frontend](https://daily.dev/tags/frontend)

[View this post on daily.dev](https://daily.dev/posts/html-first-nzhd2hxvo)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"HTML First","url":"https://daily.dev/posts/html-first-nzhd2hxvo","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/html-first-nzhd2hxvo"},"datePublished":"2023-11-12T17:13:59.528Z","dateModified":"2023-11-12T17:13:50.074Z","description":"HTML First is a set of principles that aims to make building web software easier, faster, more inclusive, and more maintainable by leveraging the default...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/119adbc7f558ccaed8a0e18f37d24b74?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/119adbc7f558ccaed8a0e18f37d24b74?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":9,"discussionUrl":"https://daily.dev/posts/html-first-nzhd2hxvo","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":144},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":9}],"keywords":"webdev,javascript,frontend","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"HTML First"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/html-first-nzhd2hxvo","comment":[{"@type":"Comment","text":"\u0026lt;%= used in any syntax is fucking cancer! Change my mind","datePublished":"2023-11-14T11:00:54.824Z","url":"https://daily.dev/posts/nzHD2hxvo#c-G9u4aTXwA","author":{"@type":"Person","name":"Le Fä De Le Lö","url":"https://daily.dev/fabooy961","image":"https://media.daily.dev/image/upload/v1677218265/avatars/avatar_H6lLM2y9S4Yf8VCWicpd8.jpg"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":8}},{"@type":"Comment","text":"I remember how this article was sharedin one of my communities, and I disagree with how it was presented. Yes, we should keep HTML as HTML, but the examples given? They’re not vanilla HTML, they just hide the javascript behind attributes and src links.\nThey say to encourage this\n\u0026lt;script src=\u0026quot;https://unpkg.com/hyperscript@0.0.7/dist/hyperscript.min.js\u0026quot;\u0026gt;\u0026lt;/script\u0026gt;\n\u0026lt;div\u0026gt;\n  \u0026lt;input type=\u0026quot;text\u0026quot; _=\u0026quot;on input put me into #output\u0026quot;\u0026gt;\n  \u0026lt;div id=\u0026quot;output\u0026quot;\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\nover this\n\u0026lt;script src=\u0026quot;https://cdn.jsdelivr.net/npm/stimulus@2.0.0/dist/stimulus.umd.js\u0026quot;\u0026gt;\u0026lt;/script\u0026gt;\n\n\u0026lt;div data-controller=\u0026quot;echo\u0026quot;\u0026gt;\n  \u0026lt;input type=\u0026quot;text\u0026quot; data-echo-target=\u0026quot;source\u0026quot; data-action=\u0026quot;input-\u0026gt;echo#update\u0026quot;\u0026gt;\n  \u0026lt;div data-echo-target=\u0026quot;output\u0026quot;\u0026gt;\u0026lt;/div\u0026gt;\n\u0026lt;/div\u0026gt;\n\n\u0026lt;script\u0026gt;\n  const application = Stimulus.Application.start();\n\n  application.register(\u0026quot;echo\u0026quot;, class extends Stimulus.Controller {\n      static targets = [\u0026quot;source\u0026quot;, \u0026quot;output\u0026quot;]\n\n      update() {\n          this.outputTarget.textContent = this.sourceTarget.value;\n      }\n  });\n\u0026lt;/script\u0026gt;\n\nBut both do the same thing, the first only hides it. And not to mention, using a library in their bad example, instead of pure html and js, which would be better.\n\u0026lt;input type=\u0026quot;text\u0026quot; id=\u0026quot;name\u0026quot; /\u0026gt;\n\u0026lt;div id=\u0026quot;output\u0026quot;\u0026gt;\u0026lt;/div\u0026gt;\n\nconst input = document.getElementById(\u0026quot;name\u0026quot;);\nconst output = document.getElementById(\u0026quot;output\u0026quot;);\n\ninput.addEventListener(\u0026quot;change\u0026quot;, (event) =\u0026gt; {\n  output.innerHTML = event.target.value;\n});","datePublished":"2023-11-22T19:26:52.207Z","url":"https://daily.dev/posts/nzHD2hxvo#c-INTZWKYFK","author":{"@type":"Person","name":"Wiktoria","url":"https://daily.dev/wiktoria","image":"https://avatars.githubusercontent.com/u/62669899?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":8}},{"@type":"Comment","text":"This is fan-freakin-tastic. As computers have become more powerful, and connections faster, it seems that we have also moved forward into making more bloated web applications. This is also reflected in ever more complex ways to create and manage those apps.\nBy going back to the basics, and trying to be frugal with code, we can go faster, make more robust apps that are faster to deliver and are more performant overall.\nI’m also seeing a movement towards simplicity with HTMX, and this  whole approach is really appealing.","datePublished":"2023-11-17T21:02:42.975Z","url":"https://daily.dev/posts/nzHD2hxvo#c-7exWEriTg","author":{"@type":"Person","name":"Ron","url":"https://daily.dev/rlnorthcutt","image":"https://media.daily.dev/image/upload/s--M-PvLeBP--/f_auto/v1732034056/avatars/avatar_oO5OL9P12gFKrSL6eUFJP"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":6}},{"@type":"Comment","text":"I believe that HMTL should be semantic and dry, with native code prioritised over libraries or frameworks. There should also be a strict separation of concerns.\nThis guide makes some good points, but it is going backwards in time, with the use of inline styling. I thought we had left those bad habits in the past? What next, using tables for structure?","datePublished":"2023-11-16T21:40:11.894Z","url":"https://daily.dev/posts/nzHD2hxvo#c-ME3EBZZcc","author":{"@type":"Person","name":"Michael","url":"https://daily.dev/michaellindo","image":"https://media.daily.dev/image/upload/s--O0TOmw4y--/f_auto/v1715772965/public/noProfile"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"Nice article! It was fun to read but I don’t agree with everything. I believe keeping HTML separate from JavaScript is a cleaner approach.","datePublished":"2023-12-27T16:33:27.535Z","url":"https://daily.dev/posts/nzHD2hxvo#c-IxFdF1jnx","author":{"@type":"Person","name":"Donald Nwokoro","url":"https://daily.dev/donguillotine","image":"https://media.daily.dev/image/upload/v1676926426/avatars/avatar_nqFB0lL74stL0Tn7Wm7rc.jpg"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
```

