Lab 28 Reflection

     Lab 28 was about creating a list of items the user could check and add on to. To do this, I opened up <form> tags in my HTML, in between these tags being 2 <input> tags with one's type set to text and the other's to submit. This, in short, creates a text area for the user to type in an item and a button which will add the typed item to the list when clicked. Next, I made the form functional in the JS by making three function; addItem, itemList, and toggleDone; that added the submitted item into an array of items, updated the HTML to reflect the addition and put a checkbox next to the item, and allowed the user to click the checkbox, respectively. Using .addEventListener, I added event listeners to the list, submit button, and text box that called these functions when the user made certain interactions with them.
     These skills are important for a web designer because they add a new level of interactivity to a website. If you're running an online store, you want your customers to add things to their shopping cart and this type of code and help achieve that. Knowing what elements are necessary to create an area to add items, like a <form> and <input>, and knowing how to use JS to made it functional helps this type of website execute its purpose.

Comments

Popular Posts