In this article we are going to learn about Javascript functions. In computer programming, a function is a set of instructions that performs a specific task. Functions are also known as procedures or subroutines. They are often used to perform mathematical ...
Continue readingJavascript querySelector
When we want to select or access one individual element on a page, we can use the querySelector() method. It returns the first element node that matches the CSS selector(s) we need. If we want to return all elemets, we ...
Continue readingJavascript Data Types
When we create a variable, we associate it with a data type. it can be a number, a text, a keyword etc. Data types, in programming, tell us what type of data a variable has, for example integers, floats, strings, ...
Continue readingThe Javascript Interrupts – setTimeout() & setInterval()
Javascript provides interrupts that we can use to call our codes after a set period of time or at specified intervals. The two methods that provide these functionalities are the setTimeout() and setInterval() methods. The setTimeout() method The setTimeout() method calls a ...
Continue readingCharacter countdown with Javascript
In this article we will look at how we can add a character countdown functionality to an input field. We will have a maximum number of characters the user can input and when the user starts typing the characters will ...
Continue readingFizzBuzz with Javascript
In this tutorial I'll show you two possible solution for the popular FizzBuzz task. The first one is ging to be an easier one, while the other will be slightly more complicated. FizzBuzz is a popular programming task that you can ...
Continue readingWhat is document.getElementById
Often we need to access element(s) or part(s) on a page to do something with it. For this we can use DOM queries. Depending on the number of elements we need to access, Javascript provides multiple methods to do that. ...
Continue readingShow and Hide div based on radio button selection
In this article you will learn how to show and hide divs or any other content on a page when clicking on a radio button using Javascript. You will learn: how to create a function how to create variables how ...
Continue readingDisable a button until a checkbox is checked
In this article we will look at how to disable a button on a form until a checkbox is checked. This is an excellent way to make the user, subscriber accept a terms of service or privacy policy before subscribing ...
Continue readingPrevent form submission with specific email domains
In this post we will use Javascript to prevent formsubmission if someone wants to use an email address that belongs to a specific email domain, such as @aol.com or @yahoo.com. If someone tries to submit the form using one of ...
Continue reading