Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Web Development Articles
Page 160 of 801
How to Create a Color Picker using HTML, CSS, and JavaScript?
We can easily create a simple color picker on a palette in JavaScript. The primary colors on a color picker are RGB i.e. Red, Green, and Blue. With the help of mixing these colors, we can form any color we want. In this article, we will be learning about how to get the RGB value from the user and form different colors with the help of CSS using the RGB color properties. The color intensity of RGB ranges from 0 to 255 where 0 is the least intensity and 255 is the highest intensity. When the intensity of ...
Read MoreCreate a Calculator using HTML, CSS, and JavaScript
To create a calculator using HTML, CSS, and JavaScript, we need to have basic understanding of working of HTML, CSS and JavaScript. Calculator is a simple tool which performs basic arithmetic calculations like Addition, Subtraction, Multiplication and Division. In this article, we are going to discuss how to create a Calculator using HTML, CSS, and JavaScript. Usually, if we observe any real-time calculator we know that it has: A grid of numbers (0-9 and 00). Basic arithmetic operators (+, -, /, x, %). Some symbols for ...
Read MoreHow to design a Loan EMI Calculator using HTML, CSS and JavaScript?
To design a Loan EMI Calculator, we will be using HTML to create the basic structure, CSS to design the user interface, and JavaScript to add functionality for calculating EMI based on loan amount, interest rate, and time period. In this article, we will understand the step-by-step process of creating a loan EMI calculator with a clean, interactive interface. Table of Contents Structuring Loan EMI Calculator using HTML Designing UI of Loan EMI Calculator using CSS Adding Functionalities using JavaScript ...
Read MoreHow to Remove Duplicate Elements from an Array in JavaScript?
To remove duplicate elements from an array in JavaScript can be achieved using various approaches. We will be understanding six different approaches in this article, which can be used according to our requirement in various cases. In this article we are having a JavaScript array and our task is to remove duplicate elements from array in JavaScript. Original Array: ["apple", "banana", "apple", "orange", "banana", "grape"] ...
Read MoreJavaScript array sorting by level
In this article, we will learn array sorting by level in JavaScript, creating a hierarchical tree structure from a flat array is a common challenge when dealing with relational data. This is a common task when dealing with hierarchical data, such as organizational charts, category trees, or file systems, where relationships like parent-child need to be represented. Problem Statement We have an array of objects representing nodes with _id, level, and parentId properties. Our goal is to transform this array into a tree structure where nodes are nested as children under their respective parents. The elements with the ...
Read MoreConverting 12 hour Format Time to 24 hour Format in JavaScript
Converting 12 hour format time to 24 hour format in JavaScript can be easily achieved using various approaches which we will be discussing in this article. For conversion from 12 hour to 24 hour format we check for the modifier (AM or PM). Depending on the modifier we convert the time formats. In this article, we have specified a time at the beginning in 12 hour format. Our task is to convert 12 hour format time to 24 hour format in JavaScript. Approaches to Convert 12-hour Format to 24-hour Here is a list of approaches to convert ...
Read MoreJavaScript: How to return True if the focus is on the browser tab page?
In this article, we will learn to check if the browser tab page is focused and under use or not in JavaScript. This is mainly required to record the user's inactivity time on the app and then take any action upon it if required. Use Cases for Monitoring Browser Tab Focus Following are the use cases for monitoring browser tab focus and user inactivity: Prevent sending network requests if the page is not being used by the user as this reduces server traffic. Save server costs by reducing unnecessary resource ...
Read MoreJavascript Program to Count Pairs with Given Sum
To count pairs with given sum is a common problem asked in job interviews and is often used in many real-world applications such as cryptography and data compression. In this article we are having an array and a target sum value, our task is to write a JavaScript program to count pairs with given sum. Array: [1, 2, 3, 5, 6, 7, 9] Target Sum: 8 1 ...
Read MoreJavaScript Program to Find Common Elements in Two Sorted Arrays
To find common elements in two sorted arrays using JavaScript, we will be discussing various approaches. Common element refers to element which is present in both the arrays. First, we will try brute force approach and then we will optimize our code to improve the time complexity. In this article we are having two sorted arrays, our task is to find common elements in two sorted arrays. Users must already know about JavaScript arrays, its function and operations on arrays, loops, searching technique and conditional statement. ...
Read MoreCalculate Subtraction of diagonals-summations in a two-dimensional matrix using JavaScript
Suppose we have a square matrix represented by a 2-D array in JavaScript like this: const arr = [ [1, 3, 5], [3, 5, 7], [2, 4, 2] ]; console.log(arr); [ [ 1, 3, 5 ], [ 3, 5, 7 ], [ 2, 4, 2 ] ] We need to write a JavaScript function that calculates the absolute difference between the sum of elements on the two diagonals of the matrix. Understanding the Diagonals In a square matrix, there are two diagonals: ...
Read More