Shubham Vora

Shubham Vora

793 Articles Published

Articles by Shubham Vora

Page 4 of 80

How to remove an added list items using JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 7K+ Views

In HTML, developers can use the 'ul' tag to create a list of items. We can add all related items to the single list and manage them dynamically using JavaScript. Sometimes, developers need to add or remove list items programmatically. We can access specific list items using their attributes and use the removeChild() method to remove them from the DOM. In this tutorial, we will explore different methods to remove list items using JavaScript, including removing specific items, the last item, and all items at once. Syntax Users can follow the syntax below to remove list ...

Read More

How to Remove Column from HTML Table using JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 4K+ Views

In HTML, tables display data in a structured format with columns and rows. Sometimes you need to dynamically remove columns from a table, such as when a user wants to hide unnecessary data or when the table structure needs to change based on user interactions. JavaScript provides several methods to remove table columns. The most common approach is using the deleteCell() method, which removes cells by index. You can also remove columns by header text or class name for more flexible implementations. Syntax The basic syntax for removing a column using deleteCell(): for (var i ...

Read More

How to remove CSS property using JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 22K+ Views

To remove CSS properties using JavaScript, you can clean up unnecessary styles, improve performance, make code easier to maintain, and simplify debugging. In this article, we'll explore different methods to remove CSS properties from HTML elements using JavaScript. We'll work with div and p elements that have various CSS properties applied. Approaches to Remove CSS Properties Here are five effective methods to remove CSS properties using JavaScript: Using the removeProperty() Method Using the setProperty() Method Using null Value Using ...

Read More

How to replace an HTML element with another one using JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 18K+ Views

In this tutorial, we will learn to replace an HTML element with another one using JavaScript. In some use cases, we require to replace a whole HTML element with a different one. For example, it is very important in form validation. Suppose we are taking the user's age from the form, and the user enters the wrong age; we can show the validation message by replacing the HTML element. Another use case where we require to replace an HTML element with another one is dynamic content loading, in which we must show the web page content based on certain ...

Read More

Explain the MUL() function in JavaScript

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 913 Views

In this tutorial, we will learn to implement the MUL() function in JavaScript. This function demonstrates multiplication using nested functions, which create closures that maintain access to outer function variables. The MUL() function showcases JavaScript's first-class function nature, where functions can be returned from other functions. There are two ways to implement the MUL() function using nested functions: Using nested functions with names Using function currying with anonymous functions Using Nested Functions With Names In JavaScript, we can use nested functions to create a multiplication function that takes arguments one at a time. Each ...

Read More

Explosion Animation in Canvas

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 2K+ Views

In this tutorial, we will learn to create an explosion animation effect using canvas in HTML. Canvas provides a powerful way to draw dynamic graphics and animations on web pages. We'll explore two different approaches: a basic particle explosion and an interactive mouse-triggered explosion effect. Basic Particle Explosion This creates an explosion of 50 randomly colored particles that originate from the center of the canvas and move in random directions. How It Works The animation works by creating particle objects with position, velocity, and color properties. Each frame, we update particle positions and redraw them ...

Read More

How to use a variable for a key in a JavaScript object literal?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 12K+ Views

In JavaScript, you can use variables as object keys using bracket notation or computed property names. This is useful when working with dynamic data, API responses, or when key names are determined at runtime. Using Bracket Notation (After Object Creation) The most common approach is to create the object first, then add properties using bracket notation: Using variables as key of JavaScript object let content = document.getElementById("content"); ...

Read More

Fastest way to convert JavaScript NodeList to Array

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 2K+ Views

In this tutorial, we will learn the fastest way to convert JavaScript NodeList to Array. NodeList is a similar structure to an array; it is a collection of DOM (Document Object Model) elements. However, array methods like 'map()', 'filter()', and 'slice()' cannot be used on NodeList objects. There are several ways to convert NodeList to Array, but this task can be done faster using these approaches: Using Array.from() function (Recommended) Using spread operator (...) By iterating with for loop Using Array.from() (Recommended) The Array.from() method ...

Read More

Image Classification using JavaScript

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 1K+ Views

Image classification is a machine learning technique that identifies and categorizes objects within digital images. When you upload a photo to Google Photos, for instance, it uses image classification to suggest locations, identify people, or tag objects automatically. We can use OpenCV to detect detailed information from images and make predictions. However, training models from scratch requires extensive datasets and computational resources. This tutorial demonstrates using ml5.js, a JavaScript library with pre-trained models that leverages browser GPU for efficient image classification. What is ml5.js? The ml5.js library provides various pre-trained machine learning models, making AI accessible to ...

Read More

Javascript Program to Minimize Characters to be Changed to make the Left and Right Rotation of a String Same

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 173 Views

In this problem, we need to find the minimum number of character changes required to make a string's left and right rotations identical. This involves understanding how rotations work and finding patterns in character positioning. Understanding Rotations The left rotation moves characters left by one position, while right rotation moves them right. For rotations to be identical, specific character patterns must exist: Odd length strings: All characters must be the same Even length strings: Characters at even positions must be identical, and characters at odd positions must be identical Problem Analysis Given a ...

Read More
Showing 31–40 of 793 articles
« Prev 1 2 3 4 5 6 80 Next »
Advertisements