Saurabh Jaiswal has Published 19 Answers

How to add 30 minutes to a JavaScript Date object?

Saurabh Jaiswal

Saurabh Jaiswal

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

In this tutorial, we will learn how to add 30 minutes to a JavaScript Date object. Here we will discuss two methods which are following. Using the setMinutes( ) Method Using the getTime() Method Using the setMinutes Method The setMinutes() function of the date object accepts an integer ... Read More

How to add rows to a table using JavaScript DOM?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 22-Aug-2022 08:26:40

We will learn how to add a row to a table using JavaScript dom. To achieve this, we have multiple methods. Some of them are the following. Using the insertRow() method By creating the new Element Using the insertRow() Method The inserRow() method is used to insert a ... Read More

How to add number of days to JavaScript Date?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 22-Aug-2022 08:21:05

In this tutorial, we will learn how to add a number of days to a JavaScript Date object. Here we will discuss two methods which are following. Using the setDate( ) Method Using the getTime() Method Using the setDate( ) Method JavaScript date setDate() method sets the day ... Read More

How to add new array elements at the beginning of an array in JavaScript?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 22-Aug-2022 08:17:40

We will learn how to add new array elements at the beginning of an array in JavaScript. To achieve this in JavaScript we have multiple ways, a few of them are following. Using the Array unshift() Method Using the Array splice() Method Using ES6 Spread Operator Using the ... Read More

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

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

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

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

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 2 hours to a JavaScript Date object?

Saurabh Jaiswal

Saurabh Jaiswal

Updated on 22-Aug-2022 07:56:00

In this tutorial, we will learn how to add 2 Hours to a JavaScript Date object. Here we will discuss two methods which are following. Using the getTime() Method Using the setHours( ) Method Using the getTime( ) Method JavaScript date getTime() method returns the numeric value corresponding ... 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

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

Advertisements