Javascript Articles

Page 3 of 534

How to Configure Mouse Wheel Speed Across Browsers using JavaScript?

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

We can use JavaScript to control the mouse wheel scrolling behavior across different browsers. Every browser has a default scrolling speed, but we can customize it to create better user experiences, such as smooth scrolling animations or controlled reading speeds. Different browsers support different wheel events, so we need to handle multiple event types to ensure cross-browser compatibility. This tutorial demonstrates various approaches to configure mouse wheel speed using JavaScript. Syntax The basic syntax for controlling mouse wheel speed uses the 'wheel' event: element.addEventListener("wheel", (event) => { event.preventDefault(); ...

Read More

A Game Using Javascript – Fire the bullets

Saba Hilal
Saba Hilal
Updated on 15-Mar-2026 667 Views

This tutorial demonstrates how to create an action-packed commando game using JavaScript and Code.org's Game Lab. The player controls a commando navigating through a maze-like area filled with enemy tanks, collecting keys, and escaping through a door. Game Story and Rules The player controls a commando using arrow keys (UP, DOWN, LEFT, RIGHT) to navigate through a walled area. The objective is to find the correct key and reach the exit door while avoiding enemy fire. Enemy tanks automatically shoot bullets when the commando enters their range. The commando has a protective shield activated by pressing the 's' ...

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 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

How to Build a REST API with Fastify?

Mukul Latiyan
Mukul Latiyan
Updated on 15-Mar-2026 2K+ Views

Fastify is a high-performance web framework designed for Node.js backend development. Known for its lightweight architecture and impressive speed, Fastify positions itself as a faster alternative to popular frameworks like Express, Koa, and Hapi. What sets Fastify apart is its plugin-centric architecture—everything is treated as a plugin, allowing for better modularity and code reusability. This approach enables developers to encapsulate functionality and distribute it across projects efficiently. In this tutorial, we will explore how to build a complete REST API with Fastify, covering: Creating a basic Fastify server Defining API routes with proper controllers Implementing schema ...

Read More

How to Bundle up JavaScript Files using Rollup.js?

Mukul Latiyan
Mukul Latiyan
Updated on 15-Mar-2026 723 Views

In this tutorial, we will understand how to use Rollup.js to bundle JavaScript files. Before we do that, the first step is to get familiar with the JavaScript module bundler called Rollup, which compiles files from multiple sources into a single bundle. Rollup is similar to webpack and Browserify. It is more popular than many other bundlers because of its ability to keep files small even after bundling them into a single unit. There are multiple features that Rollup brings to the table, some of them are mentioned below − Development is easier to manage when you ...

Read More

How do I evaluate blockchain implemented in JavaScript?

Kalyan Mishra
Kalyan Mishra
Updated on 15-Mar-2026 173 Views

Blockchain is a chain of blocks that contains information. In 2009, this technology was later adapted by Satoshi Nakamoto to create the digital cryptocurrency Bitcoin. This technology is completely open to anyone who wants to develop or analyze it. Blockchain has a feature that makes it very complex to make changes once data has been recorded in a block of the chain. Here are the key terms used in blockchain programming: Block − Contains information like data, hash value, and previous block hash value. Data − Information stored in the block (for cryptocurrency: transaction details like ...

Read More

How to create a Responsive Admin Dashboard using HTML CSS & JavaScript ?

Rohan Singh
Rohan Singh
Updated on 15-Mar-2026 10K+ Views

An admin dashboard provides important data insights and controls for managing various aspects of an application or website. In this article, we will explore the process of creating a responsive admin dashboard using the three pillars of web development: HTML, CSS, and JavaScript. Prerequisites To follow this article, you should have a basic understanding of HTML, CSS, and JavaScript. Familiarity with concepts like responsive design, CSS Flexbox, and CSS Grid will also be helpful. Step 1: Setting Up the HTML Structure We'll start by setting up the basic HTML structure for our admin dashboard. Create a ...

Read More

How to select all text in HTML text input when clicked using JavaScript?

Rohan Singh
Rohan Singh
Updated on 15-Mar-2026 7K+ Views

In web development, it is often necessary to provide users with an intuitive and convenient way to select all text within an HTML text input field when they click on it. This feature can greatly enhance user experience, especially when dealing with lengthy or pre-filled input fields. In this article, we will explore how to achieve this functionality using JavaScript. What does Selecting All Text in HTML Text Input Mean? When a user clicks on an HTML text input field, we want the entire text within that field to be automatically selected, allowing the user to easily modify ...

Read More

Get the YouTube video ID from a URL using JavaScript

Rushi Javiya
Rushi Javiya
Updated on 15-Mar-2026 2K+ Views

Every YouTube video has a unique URL through which we can access it in the browser. Every YouTube video contains a unique video id, which makes the URL unique. Sometimes, developers need to extract the video id from the YouTube URL. We need to play with the YouTube URL string to extract the video id from the URL, which we will do in this tutorial. We will learn different approaches to getting the video id from a full URL. Using the split() Method JavaScript contains the built-in split() method, which allows users to split the string into ...

Read More
Showing 21–30 of 5,340 articles
« Prev 1 2 3 4 5 534 Next »
Advertisements