<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Muaz Asif's Blog]]></title><description><![CDATA[Muaz Asif's Blog]]></description><link>https://muazasif.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 15:21:35 GMT</lastBuildDate><atom:link href="https://muazasif.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Beyond the <div>: Essential HTML Tags You Didn't Know You Needed]]></title><description><![CDATA[When I started learning web development, I barely spent more than a few hours learning HTML before moving on. I believe that most people learn "just enough" HTML before moving on to CSS and JavaScript.

🚧
Disclaimer: I am not here to convince you to...]]></description><link>https://muazasif.dev/beyond-the-div-essential-html-tags-you-didnt-know-you-needed</link><guid isPermaLink="true">https://muazasif.dev/beyond-the-div-essential-html-tags-you-didnt-know-you-needed</guid><category><![CDATA[HTML5]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Muaz Asif]]></dc:creator><pubDate>Tue, 14 Nov 2023 20:32:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1699993815539/6adcd9e7-65c6-4d11-9527-5a18bc4020f0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When I started learning web development, I barely spent more than a few hours learning HTML before moving on. I believe that most people learn "just enough" HTML before moving on to CSS and JavaScript.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">🚧</div>
<div data-node-type="callout-text"><strong>Disclaimer</strong>: I am not here to convince you to spend more time learning HTML or defend the decision to learn the bare minimum initially.</div>
</div>

<p>HTML has come a long way compared to when it was introduced. The language's (turing complete?) native features allow us access to functionalities and levels of interactivity that were previously only accessible via third-party solutions (heavy lifting by JavaScript). Nowadays, native HTML can be used to create powerful and accessible features without the need for external libraries. Here are a few of my favorite underrated HTML elements.</p>
<h2 id="heading-dialog">Dialog</h2>
<p>The <code>&lt;dialog&gt;</code> element allows you to create modal dialog boxes, which are often used to display important information or prompts to the user. Dialog boxes are natively supported in all <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog#browser_compatibility">major browsers</a>, so you don't need to use any external libraries to implement them.</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"window['example-dialog'].showModal()"</span>&gt;</span>Show Modal<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
<span class="hljs-comment">&lt;!-- It is not recommended to directly access the window object like in 
     this example. This is just for demonstration purposes --&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">dialog</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example-dialog"</span>&gt;</span>Native Dialog is Awesome!!!<span class="hljs-tag">&lt;/<span class="hljs-name">dialog</span>&gt;</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699958182218/785589a4-1242-49e1-b676-deb3b91197eb.gif" alt class="image--center mx-auto" /></p>
<p>When using dialog modals, all the behaviors of a modal such as focus trapping and background interaction blocking are built-in. Accessibility considerations include adding ARIA roles and <code>aria-modal</code> attributes.</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"window['example-dialog'].show()"</span>&gt;</span>Show Dialog<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"window['example-dialog'].showModal()"</span>&gt;</span>Show Modal<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">dialog</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example-dialog"</span>&gt;</span>
  Native Dialog is Awesome!!!
  <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"window['example-dialog'].close()"</span>&gt;</span>Close Modal<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">dialog</span>&gt;</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699962333666/61d69fbf-6de2-4768-8999-b529f9c37544.gif" alt class="image--center mx-auto" /></p>
<p>There are two types of dialogs. Using the <code>open</code> attribute on the dialog element or using the <code>.show()</code> method on the dialog element opens a non-modal dialog and using the <code>.showModal()</code> method opens a modal dialog. The difference is that when a modal dialog is open, everything outside of the modal is <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inert">inert</a> and interactions outside the dialog are blocked. Notice that when the dialog is open, the text behind the modal is not selectable, however, the document is still scrollable. To fix that, we could use the following CSS selector:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">html</span><span class="hljs-selector-pseudo">:has(dialog</span><span class="hljs-selector-attr">[open]</span>) {
    <span class="hljs-attribute">overflow</span>: hidden;
}
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">🚧</div>
<div data-node-type="callout-text"><strong>Caution: </strong>At the time of writing, <code>:has()</code> isn't supported by every browser (looking at you, Firefox). Check <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/:has#browser_compatibility">browser compatibility</a>.</div>
</div>

<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"window['example-dialog'].show()"</span>&gt;</span>Show Dialog<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"window['example-dialog'].showModal()"</span>&gt;</span>Show Modal<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">dialog</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example-dialog"</span>&gt;</span>
  Native Dialog is Awesome!!!

  <span class="hljs-comment">&lt;!-- first method --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">form</span> <span class="hljs-attr">method</span>=<span class="hljs-string">"dialog"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">button</span>&gt;</span>Ok<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span>

  <span class="hljs-comment">&lt;!-- second method --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">form</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">formmethod</span>=<span class="hljs-string">"dialog"</span>&gt;</span>Ok<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span>

  <span class="hljs-comment">&lt;!-- third method --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"window['example-dialog'].close()"</span>&gt;</span>Close Modal<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">dialog</span>&gt;</span>
</code></pre>
<p>You can close a dialog modal, either by pressing the <code>ESC</code> key or by using any of the methods above. To learn more about dialog, view the <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog">MDN docs</a> or <a target="_blank" href="https://web.dev/articles/building/a-dialog-component">this</a> article by web.dev.</p>
<h2 id="heading-details-and-summary">Details and Summary</h2>
<p>The <code>&lt;details&gt;</code> and <code>&lt;summary&gt;</code> elements allow you to create accordion menus, where users can click on a heading to expand or collapse a section of content. This is a great way to organize large amounts of information in a concise and easy-to-scan format.</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>Details and Summary<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">details</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">summary</span>&gt;</span>Click to learn more!<span class="hljs-tag">&lt;/<span class="hljs-name">summary</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Hi, this content can only be seen when details is toggled open<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">details</span>&gt;</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699965016893/de617e01-fb77-4b1f-94c0-74f265c66df4.gif" alt class="image--center mx-auto" /></p>
<p>Clicking the summary toggles the <code>open</code> attribute on the <code>details</code> element. You can also use the <code>open</code> attribute to include custom CSS styles based on the open state of the details disclosure widget.</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">details</span><span class="hljs-selector-attr">[open]</span> <span class="hljs-selector-tag">summary</span> {
  <span class="hljs-attribute">background-color</span>: red;
}
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699965952253/03098ce2-1594-4b34-a49d-2f499a1b6f31.gif" alt class="image--center mx-auto" /></p>
<p>To learn more about the <code>&lt;details&gt;</code> element, view the <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details">MDN docs</a>.</p>
<h2 id="heading-meter-and-progress">Meter and Progress</h2>
<p>The <code>&lt;meter&gt;</code> and <code>&lt;progress&gt;</code> elements allow you to create visual representations of progress bars. The <code>&lt;meter&gt;</code> element is typically used to represent a value within a specific range, while the <code>&lt;progress&gt;</code> element is used to represent the progress of a task.</p>
<p>Using <code>&lt;meter&gt;</code>, we can indicate different ranges based on what value we set for its attributes.</p>
<p>The attributes <code>min</code>, <code>max</code>, <code>low</code> and <code>high</code> set the ranges of the meter element, the <code>value</code> attribute sets the amount of the meter filled and the <code>optimum</code> attribute tells the browser how to color the ranges.</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>Meter<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">meter</span>
  <span class="hljs-attr">id</span>=<span class="hljs-string">"meterLow"</span>
  <span class="hljs-attr">min</span>=<span class="hljs-string">"0"</span>
  <span class="hljs-attr">max</span>=<span class="hljs-string">"100"</span>
  <span class="hljs-attr">low</span>=<span class="hljs-string">"33"</span>
  <span class="hljs-attr">high</span>=<span class="hljs-string">"66"</span>
  <span class="hljs-attr">optimum</span>=<span class="hljs-string">"80"</span>
  <span class="hljs-attr">value</span>=<span class="hljs-string">"30"</span>
&gt;</span>
  at 30/100
<span class="hljs-tag">&lt;/<span class="hljs-name">meter</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">meter</span>
  <span class="hljs-attr">id</span>=<span class="hljs-string">"meterMid"</span>
  <span class="hljs-attr">min</span>=<span class="hljs-string">"0"</span>
  <span class="hljs-attr">max</span>=<span class="hljs-string">"100"</span>
  <span class="hljs-attr">low</span>=<span class="hljs-string">"33"</span>
  <span class="hljs-attr">high</span>=<span class="hljs-string">"66"</span>
  <span class="hljs-attr">optimum</span>=<span class="hljs-string">"80"</span>
  <span class="hljs-attr">value</span>=<span class="hljs-string">"50"</span>
&gt;</span>
  at 50/100
<span class="hljs-tag">&lt;/<span class="hljs-name">meter</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">meter</span>
  <span class="hljs-attr">id</span>=<span class="hljs-string">"meterHigh"</span>
  <span class="hljs-attr">min</span>=<span class="hljs-string">"0"</span>
  <span class="hljs-attr">max</span>=<span class="hljs-string">"100"</span>
  <span class="hljs-attr">low</span>=<span class="hljs-string">"33"</span>
  <span class="hljs-attr">high</span>=<span class="hljs-string">"66"</span>
  <span class="hljs-attr">optimum</span>=<span class="hljs-string">"80"</span>
  <span class="hljs-attr">value</span>=<span class="hljs-string">"70"</span>
&gt;</span>
  at 70/100
<span class="hljs-tag">&lt;/<span class="hljs-name">meter</span>&gt;</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699970281241/d1564a58-d83d-4004-bad7-0e13bf35cd4e.png" alt class="image--center mx-auto" /></p>
<p>We can reverse the colors of the meter by setting <code>optimum</code> lower than <code>low</code>. This is useful when lower values are the preferred range.</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>Meter Reverse<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">meter</span>
  <span class="hljs-attr">id</span>=<span class="hljs-string">"meterLow"</span>
  <span class="hljs-attr">min</span>=<span class="hljs-string">"0"</span>
  <span class="hljs-attr">max</span>=<span class="hljs-string">"100"</span>
  <span class="hljs-attr">low</span>=<span class="hljs-string">"33"</span>
  <span class="hljs-attr">high</span>=<span class="hljs-string">"66"</span>
  <span class="hljs-attr">optimum</span>=<span class="hljs-string">"20"</span>
  <span class="hljs-attr">value</span>=<span class="hljs-string">"30"</span>
&gt;</span>
  at 30/100
<span class="hljs-tag">&lt;/<span class="hljs-name">meter</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">meter</span>
  <span class="hljs-attr">id</span>=<span class="hljs-string">"meterMid"</span>
  <span class="hljs-attr">min</span>=<span class="hljs-string">"0"</span>
  <span class="hljs-attr">max</span>=<span class="hljs-string">"100"</span>
  <span class="hljs-attr">low</span>=<span class="hljs-string">"33"</span>
  <span class="hljs-attr">high</span>=<span class="hljs-string">"66"</span>
  <span class="hljs-attr">optimum</span>=<span class="hljs-string">"20"</span>
  <span class="hljs-attr">value</span>=<span class="hljs-string">"50"</span>
&gt;</span>
  at 50/100
<span class="hljs-tag">&lt;/<span class="hljs-name">meter</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">meter</span>
  <span class="hljs-attr">id</span>=<span class="hljs-string">"meterHigh"</span>
  <span class="hljs-attr">min</span>=<span class="hljs-string">"0"</span>
  <span class="hljs-attr">max</span>=<span class="hljs-string">"100"</span>
  <span class="hljs-attr">low</span>=<span class="hljs-string">"33"</span>
  <span class="hljs-attr">high</span>=<span class="hljs-string">"66"</span>
  <span class="hljs-attr">optimum</span>=<span class="hljs-string">"20"</span>
  <span class="hljs-attr">value</span>=<span class="hljs-string">"70"</span>
&gt;</span>
  at 70/100
<span class="hljs-tag">&lt;/<span class="hljs-name">meter</span>&gt;</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699972315152/7665b161-b427-4ccb-b206-2b694901f6b3.png" alt class="image--center mx-auto" /></p>
<p>The <code>&lt;progress&gt;</code> element is simpler than <code>&lt;meter&gt;</code> as it only accepts two attributes (aside from the <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes">Global Attributes</a>) <code>max</code> and <code>value</code>. This element displays the amount that is filled in a single color, though not adding the <code>value</code> attribute animates the progress bar, which makes it look like a loading indicator.</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>Progress<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"progressVal"</span>&gt;</span>With attributes<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">br</span> /&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">progress</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"progressVal"</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"60"</span> <span class="hljs-attr">max</span>=<span class="hljs-string">"100"</span>&gt;</span>
  This isn't displayed
  <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>neither is this<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">progress</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">br</span> /&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"progress"</span>&gt;</span>Without value attribute<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">br</span> /&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">progress</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"progress"</span> <span class="hljs-attr">max</span>=<span class="hljs-string">"100"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">progress</span>&gt;</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699973080554/4d3498e4-9160-4041-8152-703bf2e80db8.gif" alt class="image--center mx-auto" /></p>
<p>Those keen enough may have noticed that the content between the <code>&lt;meter&gt;</code> and <code>&lt;progress&gt;</code> elements aren't being displayed. This is because it is intended to act as a fallback for old browsers that don't support these elements. They should not be confused as an alternative for an accessibility label.</p>
<p>To learn more about <code>&lt;meter&gt;</code> and <code>&lt;progress&gt;</code>, view the MDN docs for <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meter">meter</a> and <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress">progress</a>, respectively.</p>
<h2 id="heading-optgroup">Optgroup</h2>
<p>The <code>&lt;optgroup&gt;</code> element, as its name says, is an element that allows you to group related options in a <code>&lt;select&gt;</code> element. This can make it easier for users to find the option they are looking for, especially if the <code>&lt;select&gt;</code> element contains a large number of options.</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>Optgroup<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">select</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"beverages"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"beverages"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">optgroup</span> <span class="hljs-attr">label</span>=<span class="hljs-string">"Hot Drinks"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">option</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"coffee"</span>&gt;</span>Coffee<span class="hljs-tag">&lt;/<span class="hljs-name">option</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">option</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"tea"</span>&gt;</span>Tea<span class="hljs-tag">&lt;/<span class="hljs-name">option</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">optgroup</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">optgroup</span> <span class="hljs-attr">label</span>=<span class="hljs-string">"Cold Drinks"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">option</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"soda"</span>&gt;</span>Soda<span class="hljs-tag">&lt;/<span class="hljs-name">option</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">option</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"iced-tea"</span>&gt;</span>Iced Tea<span class="hljs-tag">&lt;/<span class="hljs-name">option</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">optgroup</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">optgroup</span> <span class="hljs-attr">label</span>=<span class="hljs-string">"Juices"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">option</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"orange-juice"</span>&gt;</span>Orange Juice<span class="hljs-tag">&lt;/<span class="hljs-name">option</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">option</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"apple-juice"</span>&gt;</span>Apple Juice<span class="hljs-tag">&lt;/<span class="hljs-name">option</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">optgroup</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">select</span>&gt;</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699990814353/cbd393e6-5554-4ef2-a5c6-9c8a68fe8007.gif" alt class="image--center mx-auto" /></p>
<h2 id="heading-input-types">Input types</h2>
<p>The <code>&lt;input&gt;</code> element has a wide variety of input types, including <code>type="color"</code>, which allows users to select a color from a color picker.</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"color"</span>&gt;</span>Input: type=color<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"color"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"color"</span> /&gt;</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699991194862/07315d18-bd28-43b2-bf95-5d0979d7b8cb.gif" alt class="image--center mx-auto" /></p>
<p>Input <code>type="file"</code> allows single or multiple file uploads. We can also use the accepts attribute to specify the allowed file types. For example, to allow users to upload only image files, you would use the following attribute:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"file"</span> <span class="hljs-attr">accepts</span>=<span class="hljs-string">"image/*"</span> /&gt;</span>
</code></pre>
<p>For specific file types, we include the string of the file extensions in a comma-separated value.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"file"</span> <span class="hljs-attr">accept</span>=<span class="hljs-string">".jpg, .jpeg, .png"</span> /&gt;</span>
</code></pre>
<ul>
<li><p>The string <code>audio/*</code> means "any audio file".</p>
</li>
<li><p>The string <code>video/*</code> means "any video file".</p>
</li>
<li><p>The string <code>image/*</code> means "any image file".</p>
</li>
</ul>
<p>e.g. to allow any image file and/or PDF files:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"file"</span> <span class="hljs-attr">accept</span>=<span class="hljs-string">"image/*,.pdf"</span> /&gt;</span>
</code></pre>
<p>To learn more about various input types, visit the <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types">MDN docs</a>.</p>
<h2 id="heading-anchor-linking-to-html-elements">Anchor: Linking to HTML elements</h2>
<p>The <code>&lt;a&gt;</code> element can be used to link to HTML elements. To link to an element, simply use the fragment identifier (#) followed by the ID of the element. For example, the following code would link to the element with the ID <code>line-break</code></p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#line-break"</span>&gt;</span>Line Break<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
</code></pre>
<p>Clicking the link above navigates directly to the specified element with the ID "<code>line-break.</code>"</p>
<h2 id="heading-bonus-vs-code-and-emmet">Bonus: VS Code and Emmet</h2>
<p>VS Code is a lightweight IDE that is popular among web developers. It comes with a pre-installed extension called Emmet, which can help you speed up your development by providing access to snippets. To use Emmet, simply type a CSS-like expression and press Tab to generate the corresponding HTML code.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1699992317692/99aae970-65ba-455e-bb08-1ff4b2ee6b1d.gif" alt class="image--center mx-auto" /></p>
<p>Here is a link to a cheat sheet for using Emmet: <a target="_blank" href="https://docs.emmet.io/cheat-sheet/">https://docs.emmet.io/cheat-sheet/</a></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>By learning about and using underrated these elements, you'll find yourself well-equipped to create compelling and accessible web experiences without unnecessary dependencies.</p>
<p>If you think that I missed an underrated HTML element, please leave a comment and share how you've used it in your project.</p>
]]></content:encoded></item><item><title><![CDATA[Breaking the Chains of Procrastination: Hello World!]]></title><description><![CDATA[After thousands of saved notes, bookmarks, posts, videos, drafts, and open tabs. I have finally hit "publish" on my first article.
Introduction
I'm Muaz Asif, a full-stack web and mobile engineer with a strong focus on JavaScript frameworks and techn...]]></description><link>https://muazasif.dev/breaking-the-chains-of-procrastination-hello-world</link><guid isPermaLink="true">https://muazasif.dev/breaking-the-chains-of-procrastination-hello-world</guid><category><![CDATA[Programming Blogs]]></category><dc:creator><![CDATA[Muaz Asif]]></dc:creator><pubDate>Sun, 05 Nov 2023 17:22:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/UiSLNUxH7sM/upload/fecbb4cd48731155db44be18d821e745.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>After thousands of saved notes, bookmarks, posts, videos, drafts, and open tabs. I have finally hit "publish" on my first article.</p>
<h1 id="heading-introduction">Introduction</h1>
<p>I'm Muaz Asif, a full-stack web and mobile engineer with a strong focus on JavaScript frameworks and technologies. I love learning about new tools, libraries, and frameworks, and I'm always eager to tinker with the latest and greatest technologies.</p>
<h1 id="heading-background">Background</h1>
<p>This article has been in the pipeline for almost two years now. In my case, it wasn't that I didn't want to write, but it was the fear of inadequacy and the pursuit of perfection that led to endless delays. The more I learned about programming, the more I felt like there was always something more to learn, a new concept to grasp, and a better way to explain it. This self-imposed pressure prevented me from sharing what I already knew.</p>
<p>On the path I was on, I might've only written a single article in my life, if I would even ever write one!</p>
<h1 id="heading-embracing-imperfection">Embracing Imperfection</h1>
<p>The turning point came when I realized that it's okay not to know everything and that the best way to learn is often through teaching. I understood that there's an audience out there craving for explanations of even the basics. That there is value in the content that I have learned, even though initially I may be blind to its value.</p>
<p>Now, even though this article may have a lot of rough edges, to me it is special. It signifies that I took the first step, the most difficult step, which also gives me a starting point to improve upon gradually.</p>
<p>I accepted that my writing might not be perfect, and that's okay. The first draft doesn't have to be flawless; it just needs to exist. Perfection can always be refined in subsequent revisions.</p>
<h1 id="heading-just-getting-started">Just Getting Started</h1>
<p>From this point forward, I plan to document my learnings and insights during my programming journey. These are exciting times for web development, where the line between server and client is blurred, and new programming paradigms are emerging. The JavaScript ecosystem is constantly evolving, with new tools and libraries released every day.</p>
<p>The current landscape may appear overwhelming, as the fragmented ecosystem means there are multiple approaches to solving the same challenges, often based on personal preference. I aim to share my perspective on existing or new solutions, helping others navigate the complex web of choices, and helping you make informed decisions.</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>I'll leave you with a quote to summarize what I want to convey with this article:</p>
<blockquote>
<p>The best time to plant a tree was 20 years ago, the second best time is now.</p>
</blockquote>
<p>I hope you enjoyed this article. Please follow me on social media or subscribe to my blog to stay updated on future posts. And, most importantly, don't be afraid to start!</p>
]]></content:encoded></item></channel></rss>