Mohit Panchasara has Published 87 Articles

HTMLCollection for Loop

Mohit Panchasara

Mohit Panchasara

Updated on 16-Feb-2023 18:39:02

5K+ Views

The HTML collection is an array of HTML elements. We can access every element of the collection using its index. Also, we can iterate through the array of HTML collections and get all HTML elements of the collection one by one. Sometimes, we require to use for loop to iterate ... Read More

How to uncheck a radio button using JavaScript/jQuery?

Mohit Panchasara

Mohit Panchasara

Updated on 16-Feb-2023 18:37:31

19K+ Views

Sometimes, we require to uncheck a radio button using JavaScript or JQuery. For example, we use the radio button in the form. When the user presses the clear form button, we need to uncheck all radio buttons and allow again users to choose any option from the radio button. In ... Read More

How to trim a string at beginning or ending in JavaScript?

Mohit Panchasara

Mohit Panchasara

Updated on 16-Feb-2023 18:36:50

2K+ Views

While working with the data, removing the unnecessary white spaces from the string is necessary. So, we need to trim a string at the beginning or end. If we keep unnecessary white spaces in the data, it can cause some issues. For example, while storing the password, if we don’t ... Read More

How to transform a String into a function in JavaScript?

Mohit Panchasara

Mohit Panchasara

Updated on 16-Feb-2023 18:35:49

2K+ Views

We have given a string and need to convert it into a function in JavaScript. Sometimes, we get mathematical or function expressions in the form of the string, and executing that expression, requires converting strings into the function expression. In this tutorial, we will learn different approaches to converting the ... Read More

How to transform a JavaScript iterator into an array?

Mohit Panchasara

Mohit Panchasara

Updated on 16-Feb-2023 18:33:24

1K+ Views

In JavaScript, the iterator is a collection of elements through which we can iterate and access a single element every iteration. The set, map, or object is an iterator in JavaScript, and we can’t access the elements of the iterator using the index like the array. So, we first ... Read More

How to toggle between one checkbox and a whole group of checkboxes in HTML?

Mohit Panchasara

Mohit Panchasara

Updated on 16-Feb-2023 18:28:30

2K+ Views

The toggling means that whenever a user checks a single checkbox, all checkboxes of the group should be unchecked, and when a user checks any checkbox from the group, a single checkbox should be unchecked. We can achieve this functionality with JavaScript. In this tutorial, we will learn to toggle ... Read More

How to skip over an element in .map()?

Mohit Panchasara

Mohit Panchasara

Updated on 16-Feb-2023 18:26:02

11K+ Views

In JavaScript, we sometimes require to skip array elements while using the map() method. For example, we need to map value from one array to another array after performing some mathematical operations on the element only if the array value is finite. In such cases, users can use the ... Read More

Previous 1 ... 5 6 7 8 9
Advertisements