Articles on Trending Technologies

Technical articles with clear explanations and examples

Difference between JavaScript and C#

Pradeep Kumar
Pradeep Kumar
Updated on 15-Mar-2026 773 Views

JavaScript and C# are two popular programming languages that serve different purposes in software development. JavaScript is primarily used for web development, creating dynamic and interactive websites that run in browsers. C# is Microsoft's object-oriented programming language used for desktop applications, web backends, mobile apps, and games. JavaScript is a client-side language that executes in web browsers, making it essential for frontend development. It's beginner-friendly with a low learning curve and can run directly without compilation. C# is a compiled, statically-typed language that requires more programming knowledge but offers better performance and structure for complex applications. What is ...

Read More

How to switch between multiple CSS stylesheets using JavaScript?

Mohit Panchasara
Mohit Panchasara
Updated on 15-Mar-2026 2K+ Views

In this tutorial, we will learn to switch between multiple CSS stylesheets using JavaScript. Have you ever thought that when you toggle the theme of TutorialsPoint's website, how it changes the CSS of the whole website? Here is a simple answer. When the user presses the button, it switches the CSS stylesheets for the website like it removes the stylesheet for the white theme and adds the stylesheet for the dark theme. Here, we will see examples of switching between multiple CSS files using JavaScript. Syntax Users can follow the syntax below to switch between multiple ...

Read More

How to Create an Image Element Dynamically using JavaScript?

Rushi Javiya
Rushi Javiya
Updated on 15-Mar-2026 13K+ Views

To create an image element dynamically using JavaScript, we can use various approaches based on our use case. We will explore three effective methods in this article with complete examples and step-by-step explanations. Approaches to Create an Image Element Here are the three main approaches to create an image element dynamically using JavaScript: Using createElement() Method Using Image() Constructor Using innerHTML Property Using createElement() Method The createElement() method is the most standard way to create DOM elements dynamically. This approach creates ...

Read More

JavaScript Program to Check if a string can be obtained by rotating another string d places

Prabhdeep Singh
Prabhdeep Singh
Updated on 15-Mar-2026 321 Views

Rotating a string means moving characters to the left or right by a specified number of positions. We'll check if one string can be obtained by rotating another string exactly d places in either direction. Problem Understanding Given two strings and a rotation count d, we need to determine if the first string can be transformed into the second string by rotating it d positions left or right. Example String 1: "abcdef", String 2: "defabc", Rotations: 3 Left rotation by 3: "abcdef" → "bcdefa" → "cdefab" → "defabc" ✓ Approach 1: Left Rotation ...

Read More

How to create and download CSV file in JavaScript?

Rushi Javiya
Rushi Javiya
Updated on 15-Mar-2026 6K+ Views

JavaScript provides powerful capabilities to manipulate data and handle various file formats. When developing web applications, you often need to export data as CSV files for users to download - such as order details from e-commerce platforms or transaction records from banking applications. In this tutorial, we will learn to create CSV files from JavaScript data and automatically download them to the user's device. Syntax The basic approach involves converting data to CSV format and using a virtual anchor element for download: // Convert data to CSV format let csvData = 'Header1, Header2, Header3'; data.forEach(function ...

Read More

How to show some custom menu on text selection?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 930 Views

In text editors like Microsoft Word, selecting text reveals a custom menu with formatting options like bold, italic, color changes, and alignment controls. This tutorial demonstrates how to create a similar custom context menu that appears when users select text on a webpage. How It Works The technique involves capturing mouse coordinates during selection and positioning a custom menu at the selection point. We use the getSelection() API to detect when text is selected and getBoundingClientRect() to calculate the menu position. Implementation Steps Step 1 − Create HTML structure with content div and hidden custom ...

Read More

How to create bar chart in react using material UI and Devexpress?

Rushi Javiya
Rushi Javiya
Updated on 15-Mar-2026 1K+ Views

Material UI is a popular React UI library that provides pre-styled components for building modern applications. DevExpress offers the 'dx-react-chart-material-ui' package that seamlessly integrates Material UI styling with powerful charting capabilities. This tutorial demonstrates how to create various types of bar charts using DevExpress charts with Material UI styling in React applications. Prerequisites Install the required packages using these commands: npm install @mui/material @emotion/react @emotion/styled npm install @devexpress/dx-react-chart @devexpress/dx-react-chart-material-ui Basic Syntax The basic structure for creating a DevExpress bar chart with Material UI: ...

Read More

JavaScript program for Mean of range in an array

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 630 Views

Given an array of numbers and a range, the goal is to calculate the mean of all the numbers within that range. This problem can be approached in various ways, but in this tutorial, we will explore a simple and efficient solution using JavaScript. Before we begin, let's define what we mean by "mean". In mathematics, the mean (also known as the average) is calculated by adding up all the values in a set of numbers and then dividing the sum by the number of values. In the context of an array, the mean of a range of values ...

Read More

How to sort element by numerical value of data attribute using JavaScript?

Abhishek
Abhishek
Updated on 15-Mar-2026 685 Views

In JavaScript, you can sort DOM elements by their data attributes using different approaches. This is useful when you need to reorder elements based on numerical values stored in data attributes. This article demonstrates two methods to sort elements by numerical data attribute values: Using the getAttribute() method to access data attributes Using the dataset property for cleaner syntax Using the getAttribute() Method The getAttribute() method retrieves the value of any HTML attribute, including data attributes. This method works across all browsers and provides explicit attribute access. ...

Read More

JavaScript Program for Merging Two Sorted Linked Lists Such That Merged List Is in Reverse Order

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 390 Views

In this tutorial, we will learn about the JavaScript Program for merging two sorted linked lists such that the merged list is in reverse order. We will first understand the problem statement with some examples. Then we will go through a step-by-step approach to solve this problem, including creating a function that takes in two linked lists as arguments and returns the merged list in reverse order. We will also discuss different approaches and their time complexity to help you choose the most efficient solution. Problem Statement We have two linked lists sorted in increasing order and our ...

Read More
Showing 14001–14010 of 61,297 articles
Advertisements