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 Nikhilesh Aleti
Page 6 of 7
How to remove event handlers in JavaScript?
An event is defined as a change in an object's state. There are a number of events in HTML that show when a user or browser performs a certain action. JavaScript responds to these events when JavaScript code is embedded in HTML and allows execution. The process of responding to events is known as event handling. As a result, JavaScript uses event handlers to handle HTML events. In this article, we are going to discuss how to remove event handlers in JavaScript. Here, we use the removeEventListener() method to remove an event handler from an element in JavaScript. ...
Read MoreHow to implement merge sort in JavaScript?
The Merge Sort algorithm is a divide-and-conquer sorting technique that recursively divides an array into smaller subarrays until each contains a single element, then merges them back in sorted order. The algorithm works by continuously splitting the array in half until it cannot be divided further. Once we have individual elements, we merge them back together in a sorted manner, comparing elements from each subarray and placing them in the correct order. Input-output Scenario Consider an unsorted array that we want to sort using merge sort: Input = [12, 34, 11, 1, 54, 25, 67, ...
Read MoreHow to clone an object in JavaScript?
An object is said to be an entity which has properties and types in it. Example, consider a Person as an object and it has properties like height, weight, age and salary. In the similar way JavaScript also have objects and their defined properties. An object in JavaScript is a complicated data type where it can store various data types in it. Let's consider this example below: const employee = { ...
Read MoreHow to remove the 0th indexed element in an array and return the rest of the elements in JavaScript?
Arrays in JavaScript are zero-indexed data structures where elements can be accessed using their index positions. The first element is at index 0, the second at index 1, and so on. const colors = ["Green", "Maroon", "Blue"]; // Index: 0 1 2 This article explores different methods to remove the first element (at index 0) from an array and return the remaining elements. Using the shift() Method The shift() method removes the first element from an array ...
Read MoreHow to find the common elements between two or more arrays in JavaScript?
In JavaScript, finding common elements between two or more arrays is a frequent requirement in web development. Arrays are objects that store multiple values, and there are several efficient methods to identify shared elements across them. Using for Loop The traditional approach uses nested for loops to compare each element of one array with every element of another array. This method works by creating an empty array and pushing matching elements into it. Example 1 Here's how to find common elements between two numeric arrays: Common elements between ...
Read MoreHow to create Olympics logo using HTML and CSS?
The given task in this article is to create an Olympics logo using only HTML and CSS. The "Olympic logo" consists of five interlocked circles with five different colors: blue, black, red, yellow, and green. These five colored rings represent the five inhabited continents of the world − Africa, the Americas, Asia, Europe, and Oceania. Approach Setting up the Logo Container − We start by creating a element with the class name olympic-logo. This serves as the container for the Olympic symbol. We set its width, height, background color, position, and margin to achieve the ...
Read MoreFlip the text using CSS
To flip the text using CSS, we will be using CSS transform property. Flipping is a technique that transforms or mirrors an element on particular axis (horizontal or vertical). We will be understanding three different approaches to flip the text using CSS. Syntax selector { transform: scaleX(-1); /* Horizontal flip */ transform: scaleY(-1); /* Vertical flip */ transform: rotateX(180deg); /* Mirror effect */ } Method 1: Horizontal Text Flip using scaleX Function To horizontally flip the ...
Read MoreFading Text Animation Effect Using CSS3
Fading is a visual representation of a gradual transition between two states of visibility. We can perform fading animation using the @keyframes rule and opacity property in CSS3. In this article we are having two div boxes with some written content in the child div. Our task is to apply fading text animation effect using CSS3. Syntax @keyframes animationName { from { opacity: startValue; } to { opacity: endValue; } } selector { animation: animationName duration; opacity: initialValue; } ...
Read MoreCreating an Animated Side Navbar using HTML and CSS
A Navigation Bar is a GUI element which allows users to navigate through a website or application. It is typically a list of links at the top or side of the screen and assists users in navigating to various areas or pages within the website. In this article, we will create an animated side navigation bar using HTML, CSS, and JavaScript. The sidebar will slide in from the left when opened and smoothly close when dismissed. Syntax #sidebar { width: 0; transition: width 0.5s; } #sidebar.open { ...
Read MoreCreate a Letter-Spacing Animation Effect using HTML and CSS
In this article, we are going to create a letter-spacing animation effect using HTML and CSS. To do so, we have CSS letter-spacing property and CSS @keyframes rule. CSS Letter-spacing Property The letter-spacing property in CSS is used to set the horizontal spacing between the text characters. If we assign a positive value for this property, the character spaces will spread farther apart. If we assign a negative value for this property, it brings the characters closer together. Syntax Following is the syntax of CSS letter-spacing property − letter-spacing: value; ...
Read More