Rushi Javiya has Published 170 Articles

How to check whether an object exists in JavaScript?

Rushi Javiya

Rushi Javiya

Updated on 19-Jan-2023 09:54:11

5K+ Views

The object contains the properties and their values in JavaScript. We can create an object using the curly ({}) braces. It’s similar to the variables, but we assign an object value rather than assigning the number, string, or boolean value to the variable. So, here we will learn to check ... Read More

How to check whether an array is a subset of another array using JavaScript?

Rushi Javiya

Rushi Javiya

Updated on 19-Jan-2023 09:50:04

7K+ Views

The first array is the subset of the second array if the second array contains all elements of the first array. So, sometimes we may be required to check if one array is the subset of another. In this tutorial, we will learn to check if one array is a ... Read More

How to combine multiple elements and append the result into a div using JavaScript?

Rushi Javiya

Rushi Javiya

Updated on 19-Jan-2023 09:22:51

6K+ Views

Sometimes, we require to manipulate the HTML elements using JavaScript. So, we can use JavaScript to add or remove HTML elements. This tutorial will teach us to combine multiple HTML elements in a single shot using JavaScript. Sometimes we need to show some HTML elements to users when they click ... Read More

How to close a current tab in a browser window using JavaScript?

Rushi Javiya

Rushi Javiya

Updated on 19-Jan-2023 09:19:02

5K+ Views

We will learn to close the browser window using JavaScript in this tutorial. Suppose users have opened your website in 2 tabs and don’t want to allow it, then you can close one tab automatically using JavaScript. Also, if you have noticed that some web apps automatically open the browser ... Read More

How to clone an array in ES6?

Rushi Javiya

Rushi Javiya

Updated on 19-Jan-2023 09:16:08

474 Views

In ES5, we used the concat method to make a copy of the array. Also, some developers used the slice() method by passing 0 as a parameter to slice all elements of the referenced array and create a new array. Example Users can follow the example below to clone the ... Read More

How to click anywhere on the page except one element using jQuery?

Rushi Javiya

Rushi Javiya

Updated on 19-Jan-2023 09:09:09

5K+ Views

We will learn to check if users have clicked anywhere on the page except one element using JavaScript and jQuery. While working with the modals, we require to close the modal when the user clicks the outside of the modal. So, we can achieve that using various methods of JavaScript ... Read More

How to check if the input date is equal to today’s date or not using JavaScript?

Rushi Javiya

Rushi Javiya

Updated on 19-Jan-2023 09:05:43

1K+ Views

We learn to check if the input date is equal to today’s date or not using JavaScript in this tutorial. Sometimes, we need to take the date from users in the input field in various formats and check if input date and today’s date match. Here, we will learn two ... Read More

How to clear the content of a div using JavaScript?

Rushi Javiya

Rushi Javiya

Updated on 19-Jan-2023 09:02:54

12K+ Views

We will learn to remove all child elements or content of a div element using JavaScript. However, whatever method we learn to clear the div element's content will work with any HTML element. Removing the content of the div element is useful when users want to display some HTML content ... Read More

10 Interesting things you can do with a few lines of JavaScript

Rushi Javiya

Rushi Javiya

Updated on 17-Jan-2023 11:15:55

174 Views

In this tutorial, let us discuss some fascinating things that a few lines of Javascript can do. Almost every website uses JavaScript. JavaScript was born in 1995, and it is a programming language similar to other languages, but it runs faster because it doesn't have many predefined functions. JavaScript can ... Read More

How to assign a PHP variable to JavaScript?

Rushi Javiya

Rushi Javiya

Updated on 17-Jan-2023 11:00:42

17K+ Views

PHP tags with single or double quotes assign a PHP value to a JavaScript variable when setting a PHP variable. Several times you might need to put PHP variable values in JavaScript. You may easily echo on the JS variable with a PHP tag if there are only simple variables, ... Read More

Advertisements