Web Development Articles

Page 156 of 801

Creating a binary spiral array of specific size in JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 246 Views

We are required to write a JavaScript function that takes in a number n. Our function should construct and return an array of N * N order (2-D array), in which the 1s take all the spiralling positions starting from [0, 0] and all the 0s take non-spiralling positions. Therefore, for n = 5, the output will look like: [ [ 1, 1, 1, 1, 1 ], [ 0, 0, 0, 0, 1 ], [ 1, 1, 1, 0, 1 ], [ 1, 0, 0, 0, 1 ], ...

Read More

How to Create a Profit and Loss Calculator using HTML, CSS, and JavaScript?

Mayank Agarwal
Mayank Agarwal
Updated on 15-Mar-2026 2K+ Views

In this article, we are going to create a profit and loss calculator using JavaScript. We will be using basic math formulas to calculate the profit and loss, returning the result in percentage along with the actual values. To calculate profit and loss, we need two values: CP (Cost Price) and SP (Selling Price). Formulas to Calculate Profit and Loss Profit: SP − CP Profit Percentage: (Profit/CP) × 100 Loss: CP − SP Loss Percentage: (Loss/CP) × 100 Creating the Calculator ...

Read More

How to access HTML elements in JavaScript?

Mayank Agarwal
Mayank Agarwal
Updated on 15-Mar-2026 19K+ Views

In JavaScript, accessing HTML elements is fundamental for creating dynamic web pages. The Document Object Model (DOM) provides several methods to select and manipulate HTML elements based on different criteria. Get HTML element by Id Get HTML element by className Get HTML element by Name Get HTML element by tagName Get HTML element by CSS Selector Get HTML element by Id The getElementById() method retrieves a single element using its unique ID attribute. This is the most efficient way to ...

Read More

Creating a Dynamic Report Card using HTML, CSS, and JavaScript

Mayank Agarwal
Mayank Agarwal
Updated on 15-Mar-2026 5K+ Views

In this article, we are going to build a dynamic report card using the inputs entered by the user. The user will enter student names and marks for different subjects, and our application will automatically calculate the total marks, average percentage, and pass/fail status. We will be using HTML, CSS, and JavaScript for the implementation. This interactive report card system allows teachers or administrators to quickly generate student performance reports by simply entering marks and clicking a calculate button. Project Overview We will create an HTML form with input fields for student name ...

Read More

JavaScript: How to allow users to change the font-size of a webpage?

Mayank Agarwal
Mayank Agarwal
Updated on 15-Mar-2026 4K+ Views

In this article, we will explore how to create a dynamic font size control feature that allows users to adjust the font size of webpage content. This accessibility feature is commonly found on government websites and helps users customize text size for better readability. We'll implement this functionality using both vanilla JavaScript and jQuery approaches to give you flexibility in your implementation. Method 1: Using jQuery This example demonstrates a simple implementation with increase and decrease buttons that modify the font size of specific content areas. Change Font ...

Read More

How to Create an Image Slider using HTML, CSS, and JavaScript?

Mayank Agarwal
Mayank Agarwal
Updated on 15-Mar-2026 9K+ Views

In this article, we are going to create a slider carousel using JavaScript. Along with using JS we will be also using HTML and CSS for representation and defining the basic layout. A carousel is basically a collection of images represented as a slideshow that is used for displaying the images, text, or both in a cyclic manner. A slider Carousel is a special type of carousel that is specifically used for displaying the slider on a website's main page. This slideshow runs in a landscape mode. We can use the eventListener() provided by the JavaScript functions to ...

Read More

How to Disable Radio Buttons using JavaScript?

Mayank Agarwal
Mayank Agarwal
Updated on 15-Mar-2026 2K+ Views

A radio button is an input type that allows users to select one option from multiple choices. In web forms, you may need to disable radio buttons dynamically based on user interactions or specific conditions. In this article, we will explore how to disable and enable radio buttons using JavaScript. We'll cover the disabled property and demonstrate practical examples where radio buttons are conditionally disabled. The disabled Property JavaScript provides the disabled property to control whether form elements are interactive. This boolean property can be set to true to disable an element or false to enable it. ...

Read More

How to Ping a Server using JavaScript?

Mayank Agarwal
Mayank Agarwal
Updated on 15-Mar-2026 8K+ Views

A server ping can be defined as hitting a server and getting a response in return from that server. The idea is to send an echo message that will keep the health check and check whether the server is up and running or not. On sending a PING every server sends a PONG that shows that the server is active. Ping messages are sent by the ICMP (Internet Control Messaging Protocol). The lower the ping time the stronger the connection between the host and the server. JavaScript Limitations for True ICMP Ping JavaScript in web browsers cannot perform ...

Read More

How to Delete a Linked List in JavaScript?

Mayank Agarwal
Mayank Agarwal
Updated on 15-Mar-2026 305 Views

In this article, we are going to explore Linked List and how to delete a linked list in JavaScript. A Linked List is a linear data structure where elements are not stored in contiguous memory locations. Each element (called a node) contains data and a pointer/reference to the next node in the sequence. ...

Read More

What are the Important Array Methods in JavaScript?

Mayank Agarwal
Mayank Agarwal
Updated on 15-Mar-2026 268 Views

In this article, we are going to explore different methods provided by Array and their importance in JavaScript. We will learn how to use them and what are their actual use cases with the help of examples. Before moving on to methods, below is the syntax for creating an array in JavaScript: let array = [element1, element2, ...]; Alternatively, we can also define the array as follows: let array = new Array(element1, element2, ...); Basic Array Methods (Adding/Removing Elements) These methods are essential for manipulating array contents: ...

Read More
Showing 1551–1560 of 8,010 articles
« Prev 1 154 155 156 157 158 801 Next »
Advertisements