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
Articles by Tarun Singh
90 articles
How to specify that the form should not be validated when submitted in HTML?
The form element in HTML enables creating interactive sections like contact forms and login forms where users can input and submit data to web servers. By default, HTML5 provides built-in form validation to ensure that user input meets specific requirements before submission. However, there are scenarios where you might want to disable form validation − such as during development, testing, or when implementing custom validation logic. HTML provides several methods to bypass the browser's default validation behavior when a form is submitted. Syntax Following are the three main syntaxes to disable form validation − Using the ...
Read MoreHow to select all links inside the paragraph using jQuery?
jQuery is a popular JavaScript library that simplifies HTML DOM traversal, event handling, and AJAX interactions for rapid web development. It offers a wide range of built-in functions and methods that help developers to manipulate HTML elements, styles, and behaviors dynamically. In this article, we will see how to select all links inside a paragraph using jQuery. Selecting links inside a paragraph is a common requirement when we want to modify the links in a particular section of our website, such as changing styles, adding event handlers, or extracting link information. How to Select All Links Inside a ...
Read MoreHow to create an array with multiple objects having multiple nested key-value pairs in JavaScript?
JavaScript is a versatile language that is widely used for creating dynamic web applications. One of the most common data structures used in JavaScript is the array. An array is a collection of elements that can be of any type, including objects. In this article, we will discuss how to create an array with multiple objects having multiple nested key-value pairs in JavaScript. What are arrays? An array is a special type of object that stores a collection of values. These values can be of any data type, such as numbers, strings, booleans, and even other arrays. Arrays ...
Read MoreHow Blazor Framework is Better Than JavaScript Frameworks?
Web development is a rapidly evolving field, and Microsoft's Blazor framework is one of the latest entrants in the arena. Blazor is a client-side web framework that allows developers to build web applications using C# and .NET instead of JavaScript. While JavaScript frameworks like Angular, React, and Vue.js have been popular choices for web development for many years, Blazor offers some unique advantages that make it an attractive alternative. In this article, we will discuss how Blazor framework may be considered better than JavaScript frameworks, including language familiarity, rendering, code sharing, tooling, security, and more. We'll also explore the ...
Read MoreHow to create an Asynchronous function in JavaScript?
A JavaScript asynchronous function is a function that runs independently of the main flow of the program. This allows the program to continue executing other code while the async function is running. The async keyword is used to declare an async function, and await is used to pause the execution until a specific asynchronous task is completed. Methods to Create Asynchronous Functions Using async/await Keywords The simplest way to create an asynchronous function is to use the async keyword before the function declaration. Syntax async function fetchData() { const response = ...
Read MoreHow can a page be forced to load another page in JavaScript?
In JavaScript, you can force a page to load another page using the window.location object. This object provides three main approaches: window.location.href property, window.location.assign() method, and window.location.replace() method. Each handles browser history differently, making them suitable for different use cases. Using window.location.href The window.location.href property contains the current URL and can redirect users to a new page. This is the most commonly used method for page redirection. Syntax window.location.href = "new_url"; You can also use setTimeout() to redirect after a delay: Delayed Redirect Example ...
Read MoreHow to create an array of partial objects from another array in JavaScript?
Arrays are one of the most commonly used data types in JavaScript. They are used to store collections of data and allow for efficient access and manipulation of data. Arrays can contain any type of data, including primitive values, objects, and even other arrays. The technique of creating an array of partial objects from an array is a valuable technique when dealing with complex data sets. Partial objects contain only a subset of the data from the original array, allowing us to focus on a particular set of data. This can be especially useful when dealing with large data ...
Read MoreHow to create an array with random values with the help of JavaScript?
In JavaScript, creating arrays filled with random values is a common requirement for simulations, games, and testing. The Math.random() method generates random numbers between 0 (inclusive) and 1 (exclusive), which can be combined with various array methods to create arrays of random values. Using Math.random() with For Loop The most straightforward approach uses a for loop with Math.random() to populate an array: Syntax // Random decimals between 0 and 1 for (let i = 0; i < arrayLength; i++) { randomArr.push(Math.random()); } // Random integers in a range for (let ...
Read MoreHow to remove indentation from an unordered list item using CSS?
To remove indentation from an unordered list item using CSS, we can use various approaches to eliminate the default spacing that browsers apply to lists. Indentation provides visual hierarchy, but sometimes we need flat, unindented lists for specific designs. Syntax ul { padding-left: 0; list-style-type: none; } Method 1: Using padding Property The most common approach uses the CSS padding property to remove the default left padding that browsers apply to unordered lists − .no-indent { ...
Read MoreHow to rotate shape loader animation using CSS?
In this article, we'll see how to rotate shape loader animation using CSS. Loading animations of different shapes is an essential part of a web app as it helps users stay engaged while they wait for a website to load. One popular type is the rotating shape loader, where a shape spins continuously until the web page is fully loaded. Moving ahead, we are going to use different approaches to rotate shape loader animations with various examples. Syntax .loader { animation: rotation duration timing-function iteration-count; } @keyframes rotation { ...
Read More