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 24 of 534
How to play a notification sound on websites?
Nowadays, web development continues to evolve and find new ways to improve the user experience. One way to improve the user's experience is by adding notifications to the website to notify users of any event. Before we start with the tutorial, let's understand why we need notifications with sounds on the website. Why Add Notification Sounds? As we said above, notification is used to enhance the user experience. We can use it to notify users for a task, such as when users completes the form submission, get a message in the chat app, for reminders, etc. ...
Read MoreHow to read all spans of a div dynamically?
One HTML element can contain multiple nested HTML elements while creating web pages. In some cases, developers may require to read the particular HTML elements of one HTML element. In our case, we require to read all span elements of the div element and extract the content of them. In this tutorial, we will learn to read the content of all spans of a div element using JavaScript and again append it to the web page in the formatted way. Syntax Users can follow the syntax below to read all spans of a div element dynamically using ...
Read MoreHow to remove “disabled” attribute from HTML input element using JavaScript?
In HTML, we can use input elements to take input from the users by creating a form or in any other way. There are different types of input elements, such as checkboxes, radio buttons, text, numbers, etc. We can use the 'disabled' property with every element to disable the input field and stop users from interacting with the input element. In some cases, we require to add and remove the disabled attribute using JavaScript. For example, we want to take the pan card numbers of the users whose age is greater than 18. So, we require to enable the ...
Read MoreHow to remove an added list items using JavaScript?
In HTML, developers can use the 'ul' tag to create a list of items. We can add all related items to the single list and manage them dynamically using JavaScript. Sometimes, developers need to add or remove list items programmatically. We can access specific list items using their attributes and use the removeChild() method to remove them from the DOM. In this tutorial, we will explore different methods to remove list items using JavaScript, including removing specific items, the last item, and all items at once. Syntax Users can follow the syntax below to remove list ...
Read MoreDetect the Operating System of User using JavaScript
JavaScript can detect a user's operating system to provide customized experiences, different interfaces, or platform-specific features. This capability is particularly useful for web applications that need to adapt their behavior based on the user's platform. In this tutorial, we'll explore two primary methods for detecting the operating system using JavaScript: The navigator.platform property The navigator.userAgent property Each method has its strengths and limitations. We'll examine both approaches with practical examples to help you choose the best solution for your needs. Using navigator.platform Property The navigator.platform property returns a string identifying the platform on ...
Read MoreCreating a Progress Bar using JavaScript
JavaScript is a powerful language that allows web developers to create dynamic and interactive web pages. One of the most useful features that JavaScript can be used for is creating a progress bar. In this tutorial, we will walk you through the process of creating a progress bar using JavaScript. A progress bar is a graphical representation of the progress of a task, and can be used to give the user feedback on how long a task will take to complete. We will use JavaScript to update the progress bar as the task progresses, giving the user a visual ...
Read MoreHow to Scrape a Website using Puppeteer.js?
Web scraping is one of the best ways to automate the process of data collection from the web. A web scraper, often called a "crawler, " surfs the web and extracts data from selected pages. This automation is much easier than manually extracting data from different web pages and provides a solution when websites don't offer APIs for data access. In this tutorial, we will create a web scraper in Node.js using Puppeteer.js to extract book information from a sample website. What is Puppeteer.js? Puppeteer is a Node.js library that provides a high-level API to control Chrome ...
Read MoreWorking with Excel Files using Excel.js
Excel.js is a powerful Node.js library for reading, manipulating, and writing Excel files. It supports both XLSX and CSV formats, making it ideal for data processing applications. Installation To install Excel.js in your Node.js project, run the following command: npm install exceljs Once installed, you can start working with Excel files programmatically. All examples in this tutorial work with XLSX (Open XML Spreadsheet) files. Working with Excel Cells The getCell() method allows you to access individual cells by reference or coordinates. Here's how to read cell values: const Excel = ...
Read MoreDifference between GET and POST Request in JavaScript
HTTP requests are fundamental to web development for sending and receiving data from servers. GET and POST are the two most commonly used HTTP request methods. Understanding their differences is crucial for building secure and efficient web applications. GET and POST requests serve different purposes and have distinct characteristics. GET requests retrieve data from a server, while POST requests send data to a server. GET requests are typically used for read-only operations, while POST requests are used for operations that modify or create data on the server. What is a GET Request in JavaScript? A GET request ...
Read MoreDifference between indexOf and findIndex Function
JavaScript provides several methods to find the index of elements in arrays. Two commonly used methods are indexOf and findIndex. While both return the index of a matching element, they work differently and have distinct use cases. The indexOf Function The indexOf method searches for a specific element in an array and returns the first index where it's found. If the element doesn't exist, it returns -1. Syntax array.indexOf(element, startIndex) Parameters element: The value to search for startIndex (optional): Position to start searching from Example const months ...
Read More