Saurabh Jaiswal has Published 43 Articles

How to add many Event Handlers to the same element with JavaScript HTML DOM?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 22-Aug-2022 08:12:29

10K+ Views

It is very common to use the events while we are programming in JavaScript. Suppose you are creating a modal that opens up on clicking a button or hovering over using the cursor, here we using two events on a single element but JavaScript does not have any official way ... Read More

How to add 10 seconds to a JavaScript date object?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 22-Aug-2022 08:08:54

4K+ Views

In this tutorial, we will learn how to add 10 seconds to a JavaScript Date object. Here we will discuss two methods which are following. Using the setSeconds( ) Method Using the getTime() Method Using the setSeconds() Method JavaScript date setSeconds() method sets the seconds for a specified ... Read More

How to add hours and minutes to a date with JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 22-Aug-2022 08:06:32

9K+ Views

In this tutorial, we will learn how to add hours and minutes to a date with JavaScript. We have multiple methods to achieve this which are the following. Add hours using the setHours() Method. Add minutes using the setMinutes() Method. Add hours or minutes with the getTime() Method. ... Read More

How to add an event handler to an element in JavaScript HTML DOM?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 22-Aug-2022 08:00:39

1K+ Views

This tutorial will teach how to add an event handler to an element in JavaScript. There are two ways to add an event handler to any element, the first is using the addEventListener method and another is using the event attributes. Using the addEventListener() Method The addEventListener() method is used ... Read More

How to add an element in the last of a JavaScript array?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 22-Aug-2022 07:51:19

5K+ Views

In this tutorial, we will learn how to add an element to the last of a JavaScript array. The most common method to add an element to the last of the array is by using the Array push() method but we will discuss multiple methods by which we can achieve ... Read More

How is NaN converted to Boolean in JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 11-Aug-2022 14:36:05

1K+ Views

In this article, we will learn how to convert NaN to Boolean. NaN in JavaScript means Not a Number, whose type is a Number but actually, it is not a number. To Convert, the NaN to a Boolean we use Multiple methods some of which are discussed below. Using ... Read More

How is NaN converted to Number in JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 11-Aug-2022 14:35:24

8K+ Views

In this article, we will learn how to convert NaN to a Number. NaN in Javascript means Not a Number, whose type is Number but actually, it is not a number. To Convert, the NaN to a Number we use Multiple methods some of which are discussed below. Using ... Read More

How null is converted to String in JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 11-Aug-2022 12:47:31

15K+ Views

In JavaScript null is a predefined keyword that represents an empty value or unknown value of no value. The data type of null is an object. In this article, we will learn how to convert null into String using multiple approaches which are following. Using the String() Method ... Read More

How null is converted to Number in JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 11-Aug-2022 12:38:34

7K+ Views

In JavaScript null is a predefined keyword that represents an empty value or unknown value of no value. The data type of null is an object. In this article, we will learn how to convert null into Boolean using multiple approaches which are following. Using Number() Method Using Logical ... Read More

How null is converted to Boolean in JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 11-Aug-2022 12:28:54

5K+ Views

In JavaScript null is a predefined keyword that represents an empty value or unknown value of no value. The data type of null is an object. In this article, we will learn how to convert null into Boolean using multiple approaches which are following. Using the Boolean function Using ... Read More

Advertisements