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
Javascript Articles
Page 41 of 534
Design a Digital Clock in Neumorphism Style using JavaScript
In this tutorial, we will be discussing how to design a digital clock in neumorphism style using JavaScript. Neumorphism is a design trend characterized by soft, raised elements with subtle shadows that create an embossed or pressed effect on the interface. HTML Structure Let's start by creating the basic HTML structure for our neumorphic digital clock. We need a container for the clock and display elements. Neumorphic Digital Clock ...
Read MoreHow is Ajax different from JavaScript Libraries and Run Time Environments?
This article explores AJAX (Asynchronous JavaScript and XML) and clarifies how it differs from JavaScript libraries and runtime environments in web development. AJAX Introduction and History Ajax, short for Asynchronous JavaScript and XML, is a technique for creating dynamic and interactive web applications. It was first introduced in the early 2000s and has since become a staple of modern web development. The key feature of Ajax is its ability to update parts of a web page without requiring a full page reload. This is achieved by using JavaScript to send and receive data from a server asynchronously, ...
Read MoreHow to check the type of a variable or object in JavaScript?
JavaScript is a loosely typed programming language, meaning there is no such rule to declare the variable type. A variable can store multiple data types in a program, so it is essential to understand the variable type before using it. In JavaScript, we can use the typeof operator to check the type of a variable or object. The typeof operator takes a variable and returns its type in a string format. In addition to the typeof operator, JavaScript also provides the instanceof operator to check the type of a variable or object. The instanceof operator accepts two arguments: the ...
Read MoreHow to create a hash from a string in JavaScript?
Before we start, let's understand the hash in JavaScript. The hash is also a string, but it's encrypted using a particular algorithm. Generally, we use the hash for security purposes. For example, Google stores users' emails and passwords in their database. Now, Google's employees can access their database for development purposes. But can they get the user's email and password from the database? No, because the password is stored in the hash form, and to decrypt the password, the employee needs the key which we used while creating the hash from the password string. So, in such a ...
Read MoreHow to store all dates in an array present in between given two dates in JavaScript?
Sometimes, we require to get all the dates between the given date range. In this tutorial, we will take two dates and find all dates between two dates. Also, we will store all dates in the array. Here, we will learn three approaches to storing all dates in an array present between given two dates in JavaScript. Using the while loop and setDate() method We can use the while loop for iteration and the setDate() method to set dates in the date object. On every iteration of the while loop, we can increase the date by one ...
Read MoreHow to swap the key and value of JSON element using JavaScript?
Here, we will learn to swap the key and value of JSON elements using JavaScript. In JavaScript, an object stores key-value pairs, and we can swap the key and value just like swapping two normal variables. In this tutorial, we will learn different approaches to swapping all the key-values of JSON elements using JavaScript. Using the for...in Loop We can iterate through the keys of the JSON object using a for...in loop. After that, we can access the value from the object using the key and swap every key-value pair in the object. We need to ...
Read MoreHow to Create a Binary Calculator using HTML, CSS and JavaScript?
A binary calculator is a program that performs mathematical calculations on binary numbers. Binary numbers consist of only two digits: 0 and 1. In this tutorial, we'll create a functional binary calculator that can perform addition, subtraction, multiplication, and division operations using HTML for structure, CSS for styling, and JavaScript for functionality. HTML Structure First, let's create the HTML structure with a form containing a display field and buttons for binary digits and operations: Binary Calculator ...
Read MoreFabricJS – How to set the dash pattern of the controlling corners of a Line?
In this tutorial, we are going to learn about how to set the dash pattern of controlling corners of Line using FabricJS. A Line element is one of the basic elements provided in FabricJS. It is used for creating straight lines. Because line elements are geometrically one-dimensional and do not contain an interior, they are never filled. We can create a line object by creating an instance of fabric.Line, specifying the x and y coordinates of the line and adding it to the canvas. We can also specify a dash pattern for the controlling corners by using the cornerDashArray ...
Read MoreHow to create a button that submits a form and downloads a pdf simultaneously?
By using HTML, JavaScript and jsPDF, we can create a button that can submit the form and download a PDF simultaneously. We will use HTML to create a form, JavaScript to handle the submission process and jsPDF to generate the PDF document. This is a common requirement in web applications where users need to submit data and receive a PDF receipt or confirmation document. Setting Up the Form First, let's create a basic HTML form with input fields to collect user information: Contact Form Enter your Name: ...
Read MoreHow to send row data when clicking the button using javascript?
When working with HTML tables, you often need to access row data when a user clicks a button. This is useful for editing, deleting, or sending data to a server. We'll explore two methods: vanilla JavaScript and jQuery. Using JavaScript to Access Row Data In this approach, we access the clicked button element, traverse up to find its parent row, then extract all column data from that row. Syntax var clickedRow = clickedElement.parentNode.parentNode.id; var rowData = document.getElementById(clickedRow).querySelectorAll('.column-data'); let text = rowData[0].innerHTML; The clickedRow contains the row ID, rowData contains all columns, and we ...
Read More