<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Oluwaseun Lawal</title>
    <description>The latest articles on DEV Community by Oluwaseun Lawal (@seuncodesnwrite).</description>
    <link>https://dev.to/seuncodesnwrite</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1082528%2Fe20bcfc2-c6c1-413a-9410-6d54c9c3055a.jpg</url>
      <title>DEV Community: Oluwaseun Lawal</title>
      <link>https://dev.to/seuncodesnwrite</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/seuncodesnwrite"/>
    <language>en</language>
    <item>
      <title>How to Add User Inputs from a Form to a Card Using JavaScript</title>
      <dc:creator>Oluwaseun Lawal</dc:creator>
      <pubDate>Sun, 21 May 2023 13:15:33 +0000</pubDate>
      <link>https://dev.to/seuncodesnwrite/how-to-add-user-inputs-from-a-form-to-a-card-using-javascript-13ph</link>
      <guid>https://dev.to/seuncodesnwrite/how-to-add-user-inputs-from-a-form-to-a-card-using-javascript-13ph</guid>
      <description>&lt;p&gt;&lt;strong&gt;Article Objective&lt;/strong&gt;&lt;br&gt;
At the end of this article, the reader will learn how to create a form and a set of cards, then how to add the inputs from the form (created with HTML and CSS) to a specific card (also created with HTML and CSS) all on a webpage using JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Article Outline&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Prerequisites&lt;/li&gt;
&lt;li&gt;Step 1: Creating a form with submit button (HTML &amp;amp; CSS)&lt;/li&gt;
&lt;li&gt;Step 2: Creating four cards and styling them (HTML &amp;amp; CSS)&lt;/li&gt;
&lt;li&gt;Step 3: Getting the form inputs (JavaScript)&lt;/li&gt;
&lt;li&gt;Step 4: Adding the form inputs to the empty card (JavaScript)&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Forms can be created for different purposes on a website or blog. For instance, a form can be created to enable a user to subscribe to an online service or to submit a complaint on a website. Also, a form can be created to get feedback from the user of a website. So, whatever a form is meant to achieve is determined by the owner(s) of a website.&lt;/p&gt;

&lt;p&gt;In this technical article, we are going to create a form that accepts user inputs; the form will have up to seven input fields in which a user can enter a laptop brand and their desired specifications. Thereafter, we will create a set of four cards listing laptop brands and their specifications. The first, second, and third cards are going to be pre-filled with specifications while the fourth card remains empty (input will come from the user).&lt;/p&gt;

&lt;p&gt;Now using JavaScript, at the click of the “Submit” button, the user inputs from the form we created is then added to the empty card so that it looks like the other three cards. All of these is quite straightforward to achieve by following the steps I have outlined in this article.&lt;/p&gt;

&lt;p&gt;Without further long talks, let’s get started.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We need to first create a form that accepts user inputs using plain HTML and CSS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then we need to create a set of cards also using plain HTML and CSS.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are just starting out learning HTML and CSS, follow Step 1 and Step 2 closely on how to create a form and a set of cards respectively.&lt;br&gt;
If you are already familiar with how to create a form and a set of cards using HTML and CSS, you can jump to Step 3 and continue.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 1: Creating a form with submit button (HTML &amp;amp; CSS)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first thing we have to do is to open up our code editor (VS Code used here) and create three separate files which are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;index.html&lt;/li&gt;
&lt;li&gt;style.css&lt;/li&gt;
&lt;li&gt;script.js&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We then get started under HTML by entering Shift + ! or inputting html5 and hitting enter to load up the default HTML codes. The next thing to do is to link the other two files (i.e., CSS and JavaScript) to our HTML file. The following screenshot explains better.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KZ0Cwb5V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yoc2w9orunou0cyqocgy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KZ0Cwb5V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yoc2w9orunou0cyqocgy.png" alt="HTML header" width="646" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: ‘defer’ used in the JavaScript link is to tell the server to first load HTML and CSS files before executing JavaScript.&lt;/p&gt;

&lt;p&gt;We proceed to create the form (using form object in HTML) inside a container and it will have the following inputs: a header, Laptop name, Processor, Generation, RAM, SSD, Screen size, and Backup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aJiz_NZD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jhnatsrm2i1eki6vaq7c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aJiz_NZD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jhnatsrm2i1eki6vaq7c.png" alt="Form container" width="607" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In order to style the form and be able to access each of the input fields in JavaScript, we have to use a selector (&lt;em&gt;class name&lt;/em&gt;) – as the screenshot above shows – for each of the input fields. The selectors can now be used to style the form in CSS:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4J3zs-SW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2f913t8odorxnfuxakxp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4J3zs-SW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2f913t8odorxnfuxakxp.png" alt="Body and form styling" width="304" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gNSLDmw0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1szd67maevomp1ljpxjk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gNSLDmw0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1szd67maevomp1ljpxjk.png" alt="Form and button styling" width="424" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The form will appear as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zp0JMw55--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zpggnaqy1cre7rl2knxf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zp0JMw55--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zpggnaqy1cre7rl2knxf.png" alt="Form image" width="233" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are done with creating the form and we proceed to the next step.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 2: Creating four cards and styling them (HTML &amp;amp; CSS)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here, we are going to create four cards which will all have laptop brand specifications, out of which three of them will be pre-filled and the remaining one left blank. The four cards are each going to have the following selectors: &lt;em&gt;card1&lt;/em&gt;, &lt;em&gt;card2&lt;/em&gt;, &lt;em&gt;card3&lt;/em&gt;, and output and be placed inside a parent container which is going to have the selector &lt;em&gt;specs-container&lt;/em&gt;. Each of the four cards are going to have different image and similar styling (though with different background colors).&lt;/p&gt;

&lt;p&gt;Here are the HTML codes to create the cards:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sm5DXguD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jyadaf4jrkv4rcyjo1mh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sm5DXguD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jyadaf4jrkv4rcyjo1mh.png" alt="HTML codes for cards" width="515" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_sNmtuXz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hr4fxjms127n43x15eew.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_sNmtuXz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hr4fxjms127n43x15eew.png" alt="HTML codes for card" width="523" height="537"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In order to style these cards, we will apply the following CSS styles:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_RHUofIj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lx76b51ecb1az1q3itjq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_RHUofIj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lx76b51ecb1az1q3itjq.png" alt="specs container styling" width="428" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PibF0_JO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zs1l5zijr3bnb5p37u2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PibF0_JO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zs1l5zijr3bnb5p37u2.png" alt="specs card styling" width="314" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now after applying all these CSS styles, the cards should finally look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4zoD_H94--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gbruxt7nkxbkdtuavp6z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4zoD_H94--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gbruxt7nkxbkdtuavp6z.png" alt="Form and cards" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: The laptop images displayed in the cards does not represent the real laptops with those specifications.&lt;/p&gt;

&lt;p&gt;As you can see, the empty card is only having labels and there are no specifications indicated – which is because we want the specifications to come from the user via the form we created. But in order to transmit the user inputs in the form to the empty card, we need JavaScript and this leads us to the next step.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 3: Getting the form inputs (JavaScript)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before the inputs of the form can be transmitted and displayed in the empty card, we need to write a function in JavaScript with the name we specified in the submit button onclick function in HTML i.e., submitBtn( ).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0GtK-mb7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2a59ehkcpiuqm3qlivim.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0GtK-mb7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2a59ehkcpiuqm3qlivim.png" alt="onclick" width="570" height="23"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then we need to get the actual value of each input in the form using their selector (class name) and adding &lt;em&gt;.value&lt;/em&gt; in JavaScript. Since we will be using the class name of each input, we have to use &lt;em&gt;document.querySelector&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Here are the JavaScript codes to get the form input:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cqylW6Ai--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7liszbvdpgj3ecrkj3w3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cqylW6Ai--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7liszbvdpgj3ecrkj3w3.png" alt="JavaScript for form input" width="664" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this, we can get the actual value of whatever specifications a user enters into the form for the laptop name, processor, generation, RAM, SSD, screen size, and backup. But when the user clicks the submit button, nothing is going to happen – all the inputs will remain on the form. This is because at the click of the submit button, the form inputs goes nowhere since we haven’t specified where it should go.&lt;/p&gt;

&lt;p&gt;Specifying where the form inputs should go is what we will treat in the next step.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 4: Adding the form inputs to the empty card (JavaScript)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To be able to transmit the form inputs to the empty card, we need to get the exact location of the specification that matches the form input using JavaScript. This means the output on the card must match the input from the form.&lt;/p&gt;

&lt;p&gt;For us to get the actual value of each output in the empty card, we use their selector (id) and to do that, we have to use &lt;em&gt;document.getElementbyId&lt;/em&gt;. To access the individual content in the card, we say &lt;em&gt;.textcontent&lt;/em&gt; and to finally transmit each form input to the output, we equate the output to the corresponding input.&lt;/p&gt;

&lt;p&gt;Here are the JavaScript codes to transmit the form inputs to the outputs in the empty card:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YbLrlz3I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kspraalf6qcpol6gnocx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YbLrlz3I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kspraalf6qcpol6gnocx.png" alt="JavaScript codes for output" width="601" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now with this, anything a user enters into each of the form inputs will go to the corresponding output on the card.&lt;/p&gt;

&lt;p&gt;But there is a little problem here. The problem is that the webpage will automatically refresh itself at the click of the submit button, meaning that all the form inputs will show briefly on the card before the webpage get refreshed.&lt;/p&gt;

&lt;p&gt;By default, the submit button refresh a webpage. But in order to prevent this from happening, we need to write a JavaScript code that prevents the submit button from refreshing the webpage which will then allow the form inputs to be transmitted to the empty card.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xpdd_4Px--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/whx97pnxmkntx3ztr3k0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xpdd_4Px--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/whx97pnxmkntx3ztr3k0.png" alt="JavaScript to prevent submit button default behavior" width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, with this, the form inputs should be transmitted to the empty card without the webpage being refreshed automatically.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1HRRLvtN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0mtrpvq2wmeje23buvkf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1HRRLvtN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0mtrpvq2wmeje23buvkf.png" alt="User inputs in form" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rWeO22xV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/38u352sq1erxhsg5hstk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rWeO22xV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/38u352sq1erxhsg5hstk.png" alt="User inputs showing on empty card" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see from the second screenshot, all the input fields in the form got cleared after the submit button was clicked and the inputs transmitted to the empty card. This is because in the code above, the following was specified:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JpEW5gUX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e36txw8wezj0lzppr8vh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JpEW5gUX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e36txw8wezj0lzppr8vh.png" alt="Inputs cleared for form fields" width="302" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What this code does is to return each of the input fields in the form to null after the submit button is clicked.&lt;/p&gt;

&lt;p&gt;Below is the code implementations for this project on my Codepen.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; The laptop image for each card is not showing due to issues with uploading images on Codepen.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;iframe height="600" src="https://codepen.io/seun_codes_writes/embed/ZEmZjyM?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;

&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
In this technical article, we have been able to learn about how to add user inputs from a form to a card using JavaScript. The steps taken to achieve this are pretty straightforward and it is easy to implement on a webpage. The card that was used here to display the form inputs is just the example I chose, actually you can transmit the inputs from a form to any part of your webpage. So if you are looking to build a website with a form that accepts inputs and transmit it to a card (or somewhere on your webpage), you won’t go wrong following the steps above.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>css</category>
    </item>
    <item>
      <title>How to Create Tri-category To-do Lists Using JavaScript</title>
      <dc:creator>Oluwaseun Lawal</dc:creator>
      <pubDate>Fri, 19 May 2023 03:36:52 +0000</pubDate>
      <link>https://dev.to/seuncodesnwrite/how-to-create-tri-category-to-do-lists-using-javascript-3855</link>
      <guid>https://dev.to/seuncodesnwrite/how-to-create-tri-category-to-do-lists-using-javascript-3855</guid>
      <description>&lt;h2&gt;
  
  
  Article Objective
&lt;/h2&gt;

&lt;p&gt;At the end of this technical article, first, the reader will learn how to create three categories of to-do lists with delete (‘X’) button. Secondly, the reader will learn how to get the inputs to show in each to-do list. Then finally, the reader will learn how to use the delete (‘X’) button to delete individual to-do list.&lt;/p&gt;

&lt;h2&gt;
  
  
  Article outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 1&lt;/strong&gt;: Creating a simple heading and adding background image (HTML &amp;amp; CSS)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: Creating a section that will contain the to-do lists (HTML)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 3&lt;/strong&gt;: Styling the section and each of the to-do lists (CSS)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 4&lt;/strong&gt;: Declaring all the variables (JavaScript)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 5&lt;/strong&gt;: Getting user inputs to display in each to-do list category (JavaScript)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 6&lt;/strong&gt;: Activating the delete button and adding a prompt to it (JavaScript)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A to-do list is simply a written list of tasks or errands that one needs or intends to carry out over a given time or in a certain place. Generally speaking, we humans are prone to forgetfulness, especially when we have a lot of things to do day in, day out – which is where a to-do list can really help us. To-do list is a productivity tool that can help us to list out tasks we intend to accomplish and then crosscheck to see if we’ve accomplished them. It also serves as a memory aid to help us remember what we need to do at a given time or even place.&lt;/p&gt;

&lt;p&gt;In this article, we are going to create tri-category to-do lists with JavaScript, whose user interface will be designed using plain HTML and CSS. These tri-category to-do lists are going to contain to-do list for home, to-do list for workplace, and to-do list for grocery store. Each of these to-do lists are going to work independently of each other, that is, what the user enters into any of the category won’t show in the other categories. With this, a user can enter a specific to-do in each of the to-do list categories.&lt;/p&gt;

&lt;p&gt;Let us get started creating these tri-category to-do lists.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Step 1: Creating a simple heading and adding background image (HTML &amp;amp; CSS)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first thing we have to do is to open up our code editor (VS Code used here) and create three separate files and then link the CSS and JS files in the HTML.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ysoPxMRB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w963r9u1up2g5h1tiptx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ysoPxMRB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w963r9u1up2g5h1tiptx.png" alt="HTML, CSS, and JS file linking" width="584" height="229"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then we can proceed to create a simple heading indicating what we are doing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9gXLvYe_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b03raej6z4l1l3u2jw5x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9gXLvYe_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b03raej6z4l1l3u2jw5x.png" alt="Heading in HTML" width="416" height="97"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's add some CSS styling:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8O2La4oe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8f7plev88orapekonpdj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8O2La4oe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8f7plev88orapekonpdj.png" alt="Styling for heading" width="365" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After applying these styles, it should now look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V-zBj-32--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdfrgsorpgmslyusfom9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V-zBj-32--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdfrgsorpgmslyusfom9.png" alt="Image description" width="692" height="30"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s proceed to use a background image in the body of our to-do lists project. &lt;br&gt;
To do this, you can download an image of your choice (from Pexels, Freepik, Pixabay etc.) to the folder containing the files of this project to serve as the background image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ahIs38iq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9okfq8v92w350ubsr7sf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ahIs38iq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9okfq8v92w350ubsr7sf.png" alt="Adding background-image through CSS" width="379" height="81"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Tf_L2id5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19m08b2jiawyl6xxdgyf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Tf_L2id5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19m08b2jiawyl6xxdgyf.png" alt="Background-image" width="657" height="409"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Creating a section that will contain the to-do lists (HTML)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here, we are going to create a section that is going to contain the three categories of to-do lists, which are to-do list for home, to-do list for workplace, and to-do list for grocery store.&lt;/p&gt;

&lt;p&gt;We are going to create three containers inside this section and these containers are going to have the following class names: &lt;em&gt;home&lt;/em&gt;, &lt;em&gt;workplace&lt;/em&gt;, and &lt;em&gt;grocerystore&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Inside each of these containers, we are going to have a heading (to indicate the different to-do list), input (for text), button (add), and an empty unordered list in which each entered to-do list will be stored. In order to style them, we are going to give all of the aforementioned a class name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--r1Eeuh-0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g0xyh32n94wimgww6ob3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r1Eeuh-0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g0xyh32n94wimgww6ob3.png" alt="Class name for container elements" width="800" height="578"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, the unordered list in each of the to-do list containers has a list that contain a to-do entry and a button (to delete an entry) but which have all been commented out. There are two reasons for doing this. The first reason is because we want the to-do list entry to come from a user. Secondly, it is only to show the selectors (class names) given to the list and the button, which we are going to make use of in CSS and JavaScript.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Styling the section and each of the to-do lists (CSS)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The section is the first thing we start with and the major styling include: width: 90%; margin: auto; display: grid; and grid-template-columns; which makes the to-do lists responsive. Then we style the elements inside the first to-do list container and then style the heading - making the font bigger and giving it a standout color. Thereafter, we style the input field and the add button to make them eye-pleasing. Finally, we style the empty unordered list and also style the appearance of the list so that each to-do list entry will have that same appearance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rC7-EOt2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hap259cy96iq8s1qrzfq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rC7-EOt2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hap259cy96iq8s1qrzfq.png" alt="Image description" width="426" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MqVbJOCD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i5i38ewf4la37nkv7wz1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MqVbJOCD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i5i38ewf4la37nkv7wz1.png" alt="Image description" width="253" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MnvQ3F35--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5d3odczbzqgvpvs7nya.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MnvQ3F35--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5d3odczbzqgvpvs7nya.png" alt="Image description" width="422" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the other two categories of to-do lists to have the same appearance as the first, we are going to apply the same styling to them. Though we are making use of the same styling, but for the sake of easy differentiation, we need to add a figure to the selectors (i.e., class names) used. The list class inside the empty unordered list is the only class name that we are not going to repeat and which is going to be used for the three categories of to-do lists.&lt;/p&gt;

&lt;p&gt;Styling for the second to-do list category:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qX73aa8v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/82z65lb6249ajkgzk25o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qX73aa8v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/82z65lb6249ajkgzk25o.png" alt="Image description" width="272" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CxvbqYQ4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6yg0l5tx5aoj6i4r2lky.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CxvbqYQ4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6yg0l5tx5aoj6i4r2lky.png" alt="Image description" width="238" height="321"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Styling for the third to-do list category:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zl3oBGHu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vzm9hntbqr3enb8x3lck.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zl3oBGHu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vzm9hntbqr3enb8x3lck.png" alt="Image description" width="282" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uSSRVtJm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/260vfx51d65d604ricpn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uSSRVtJm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/260vfx51d65d604ricpn.png" alt="Image description" width="263" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After applying all of these styling, we are going to have tri-category to-do lists that look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CPD47DPz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cete00qdwlvc1jd6urdz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CPD47DPz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cete00qdwlvc1jd6urdz.png" alt="Image description" width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Declaring all the variables (JavaScript)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are done with designing the interface of our tri-category to-do lists, but they won’t work without JavaScript. So, the first thing we have to do is to declare all the variables (that points to the selectors) in JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fuowHuLy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xg6jczy7hnul0ifvilm8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fuowHuLy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xg6jczy7hnul0ifvilm8.png" alt="Image description" width="437" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this, we can have access to the input field, the add button, and the empty unordered list all inside their respective HTML containers.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Getting user inputs to display in each to-do list category (JavaScript)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that we have declared all the variables, we need to get the input (i.e., to-do entry) of the user to display in each to-do list category. Here is what we need to do in JavaScript:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KDpMUHMv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pcuvdrk4kmbbwjuh6i2c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KDpMUHMv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pcuvdrk4kmbbwjuh6i2c.png" alt="Image description" width="348" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since we want each to-do list category to work independently, we have to copy these same lines of code for the other two to-do list categories but we have to differentiate their variables i.e., btn2, deletebtn2, btn3, deletebtn3 etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H121uH6W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f1if2rdhcaeigrt9sd10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H121uH6W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f1if2rdhcaeigrt9sd10.png" alt="Image description" width="357" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ih9QMQ4r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5jerag16t6qnguqe4369.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ih9QMQ4r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5jerag16t6qnguqe4369.png" alt="Image description" width="345" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After these JavaScript codes have been implemented, our tri-category to-do lists gets working and whatever to-do a user enters for one category will only show up there (unless the user types the same to-do in another category).&lt;/p&gt;

&lt;p&gt;So, this is how it is going to look like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wON1yu86--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0khssbl3bjsn2rlr5j0w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wON1yu86--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0khssbl3bjsn2rlr5j0w.png" alt="Image description" width="800" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see from here, each to-do list work independently and doesn’t interfere with each other. The next thing we want to do is to activate the delete button and add a prompt to it.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;Step 6: Activating the delete button and adding a prompt to it (JavaScript)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that our tri-category to-do lists are working, we want to activate the delete button so that a user will be able to delete any to-do entry that has been accomplished. We want to also add a prompt to ask the user if they are sure of deleting a to-do entry.&lt;/p&gt;

&lt;p&gt;Here is what we need to do in JavaScript:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o1pozCiD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3lxdwnigu53ivrlxek33.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o1pozCiD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3lxdwnigu53ivrlxek33.png" alt="Image description" width="525" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, what we are going to do is to make this the last lines of code under the JavaScript codes for each to-do list category as laid out in Step 5. After this is done, it will now be possible to delete any to-do entry in each of the to-do list category.&lt;/p&gt;

&lt;p&gt;We then need to enter to-dos again because the added JavaScript codes for the prompt automatically refresh the page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2mmvTmi9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ju0srpi115wdk4qs4yt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2mmvTmi9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ju0srpi115wdk4qs4yt.png" alt="Image description" width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The delete button on the first to-do entry was clicked on and it displayed the prompt shown in the snapshot. After clicking OK, the first to-do entry in the to-do list for home is deleted and we have the result below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PnC6Q5qC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d9d26zy8yv8bq1i52yx1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PnC6Q5qC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d9d26zy8yv8bq1i52yx1.png" alt="Image description" width="800" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below is all the code implementation for this project in my Codepen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please note&lt;/strong&gt;: I've changed the &lt;em&gt;body&lt;/em&gt; "background-image" to "background-color" in Codepen because I had issues adding background image in Codepen, other than this, nothing else changes.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/seun_codes_writes/embed/VwVNvEK?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
In this article, we focused on creating tri-category to-do lists that can be useful for managing to-dos for the home, work place, and the grocery store. The interface of the to-do lists was designed with plain HTML and CSS and functionality was added to them using JavaScript. This project was developed for beginners who are still trying to get a hang of JavaScript.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
