How to add dark mode using javascript

We’re going to be adding dark mode to a simple website using javascript and the localStorage property of the window object. The localStorage property will be used in order to maintain dark mode even after the page is refreshed. Note: Before we start, I’d like to say that the best way to gain a lot from this tutorial is by following along, especially if you are a beginner.. (though it’s not necessary, it’s better if you could)....

June 28, 2022 · 4 min · Jima Victor

How to download and install Node.js and NPM on windows 10

This post is going to focus on how to install node.js on your windows 10 operating system and i am also going to show you how to setup your path environment variables for node.js so you can be able to use node.js from any directory in your computer system. STEP 1: Download Node.js First of all, you need to download and install node.js from the official website On the website, the Long Term Support(LTS) version (which also includes npm) will be selected by default but if by any means it is not, please make sure it is selected because that is the version we want and it is also recommended for most users....

April 15, 2022 · 3 min · Jima Victor

How to create a three state toggle switch using HTML, CSS and JavaScript

In this tutorial, I am going to show you how to build a toggle switch with three states. Normally, a toggle switch has just two states: ON and OFF. That’s why it’s called a toggle switch. However, the other day, while I was browsing the Frontend Mentor website, searching for some frontend development challenges to work on, I came across the calculator challenge on their website. Working on this challenge required building a toggle switch with three states....

March 9, 2022 · 5 min · Jima Victor

Javascript forEach - loop through js array items

So imagine you went fruit shopping and you came back home with a basket of fruits. You need to store these fruits separately i.e you need all apples to be put together, all bananas to also be put together, all oranges to be put together and so on.. If you only had around 20 fruits in the basket, it will be relatively easy to complete this task. However, if the number was increased to about 50 - 60 fruits in this basket, then it becomes difficult and the difficulty of this task gradually increases as the number of the fruits does....

January 28, 2022 · 3 min · Jima Victor

HtmlCollection vs NodeList in Javascript

At some point in your journey as a developer, you might have come across this error. If you haven’t come across this error, maybe one day you will. The above error occurs as a result of trying to use the forEach array method on an htmlCollection. What is an htmlCollection Well, an htmlCollection is a live and ordered list of nodes that represents a collection of HTML elements extracted from the DOM....

January 10, 2022 · 3 min · Jima Victor