<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dhaval singh on Medium]]></title>
        <description><![CDATA[Stories by Dhaval singh on Medium]]></description>
        <link>https://medium.com/@dhavalsingh19?source=rss-880e566edd56------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*6MmkBGCxIDM7jZmA_w3nOw.jpeg</url>
            <title>Stories by Dhaval singh on Medium</title>
            <link>https://medium.com/@dhavalsingh19?source=rss-880e566edd56------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 03:56:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dhavalsingh19/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why one should always learn by actually coding and not just watching!]]></title>
            <link>https://medium.com/@dhavalsingh19/why-ones-should-always-learn-by-actually-coding-and-not-just-watching-2e6c214f61ea?source=rss-880e566edd56------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e6c214f61ea</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Dhaval singh]]></dc:creator>
            <pubDate>Thu, 14 May 2020 23:35:02 GMT</pubDate>
            <atom:updated>2020-05-15T06:44:02.488Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J0dOqsLHJ2nfZMaE.jpg" /></figure><p>I am new to web development and recently started learning HTML, Java Script and what not. There are tons of wonderful video tutorial’s out there when it comes to learning Java Script and i started watching few of the famous ones. After a few days, i thought its better to start working on some small projects to get a better grasp on the language. I found<a href="https://www.udemy.com/course/web-projects-with-vanilla-javascript/?referralCode=F9B7C7FED834F91ADE75"> 20+ Web Projects With Vanilla JavaScript</a> by <em>Brad Traversy</em> and immediately started with the first project of making a Form validator.</p><p>I split my screen,on one side my editor and other the video and started coding along. Here is when things got interesting. Now since he was showing the changes in the website side by side i didn’t check mine at regular intervals.</p><p>After making the basic layout on HTML and CSS i just ran it once to see if it rendered properly and everything was fine. Halfway through the JS part, i thought ill just check once to see if all’s well and lo and behold, there was an error.</p><p>I’ll give you a chance to see if you can figure out what went wrong.</p><p>This is a simple HTML code for making a form with few field’s to get the input, nothing too complex.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1059f2f5e95a509d2783d63c5ebb2ba5/href">https://medium.com/media/1059f2f5e95a509d2783d63c5ebb2ba5/href</a></iframe><p>Now here is the simple Javascript code for which it started giving and error.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b79fb136056f6941fb41a1e65c62dca/href">https://medium.com/media/7b79fb136056f6941fb41a1e65c62dca/href</a></iframe><p>The error was quite simple to understand, it said</p><blockquote><strong>TypeError: form is null</strong></blockquote><p>and was happening in the first line itself. My first go to reaction was to check for these</p><ol><li>Invalid HTML syntax (some tag is not closed or similar error)</li><li>Duplicate IDs — there are two HTML DOM elements with the same ID</li><li>Maybe element you are trying to get by ID is created dynamically (loaded by ajax or created by script)?</li></ol><p>I checked and checked, but nothing. I had already spent 20 mins on this and i got annoyed. Giving up at last, i went to his git repository and found his code for the same and checked if i had missed something, but to no avail.</p><p>In the end i found an online file difference checker and put his code against mine. There were barely any “mistakes”. Other than few text lines, only one difference was there.</p><p>He had loaded the script file in the end,unlike me who out of the usual habit loaded it in the head section. At first i ignored it, barely thinking about it. But after a few minutes i gave up and started reproducing his code line for line. As soon as i put my script in the end, everything started working.</p><p>And then it hit me, where i load the script matters as lot. I am assuming most of you understood the mistake here, but for anyone who didn’t, here it goes.</p><p>The &lt;<strong>script</strong>&gt; <strong>tag</strong> can be placed in the &lt;head&gt; section of your <strong>HTML</strong>, in the &lt;body&gt; section, or after the &lt;/body&gt; close <strong>tag</strong>, depending on when you want the JavaScript to load. Since i was using the “form” attributes in my script it has to be loaded after otherwise it wont know what value to take.</p><p>I know, it’s a really silly mistake, but one that made me realize how important it is to code things yourself otherwise be prone to making such stupid mistakes for a long time, get frustrated and stop learning altogether.</p><p>PS: I found a really great<strong> </strong><a href="https://andreasbm.github.io/web-skills/"><strong>resource</strong></a> to help web developers get a visual overview of various skills that can be useful to learn. It is useful for people who just started learning about web development and for people who have been in the field for years and want to learn new things. I personally found it amazing, i hope you can find some use out of it too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e6c214f61ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>