Saurabh Anand has Published 19 Articles

How to create a function `generateSelector` to generate CSS selector path of a DOM element ?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:38:14

The generateSelector method is a helpful tool for determining the path to a specific portion of a website known as a DOM element. Understanding how CSS selectors work and how to build them can be useful in a variety of situations, such as testing automation or the construction of shortcuts ... Read More

How to create a button that submits a form and downloads a pdf simultaneously?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:33:07

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. The act of submitting a form and getting ... Read More

How to Create a Bootstrap Spinner and Display on Screen till the data from the API loads ?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:31:43

Using Bootstrap, we will create a Bootstrap spinner and display it on the screen until data from an API is loaded. This will give customers visual indications that something is going on in the background and can be an excellent method to improve the user experience. In this blog, we ... Read More

How to Create a Binary Calculator using HTML, CSS and JavaScript?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:29:03

A binary calculator is a program that performs mathematical calculation on binary numbers. Now, as of you remember the binary numbers are those numbers which are formed from only two numbers i.e., 0 and 1. In this blog, we will use this program to calculate addition, subtraction, multiplication and division ... Read More

How to create 3D Geometries in webGL and p5.js?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:27:50

Creating 3D geometries in webGL and p5.js is a powerful way to create interactive and visually interesting web applications. With the ability to create basic shapes, add textures, lighting, and materials, and transform 3D geometries, we can create a wide range of 3D graphics and animations. By understanding the basics ... Read More

How to count the number of times a button is clicked using JavaScript?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:26:33

Tracking button clicks is a common task in JavaScript and can be achieved by using the addEventListener() method. By adding an event handler method to the button element and incrementing a variable each time the button is pressed, we can simply keep track of button clicks. We can quickly show ... Read More

How to count text lines inside of a DOM element?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:21:47

Introduction Before understanding the counting of the lines in a DOM, let's first understand what DOM is? So, DOM is like an API for HTML and XML documents. This logic is enough to understand that DOM is an important concept for web developers. The DOM gives a programming interface ... Read More

How to copy the content of a div into another div using jQuery?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:16:52

We can use jQuery html() method to copy the content of a div into another div. In jQuery, many other methods, such as clone(), append() & appendTo(), etc., can be used to copy the content. jQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as ... Read More

How to convert UTC date time into local date time using JavaScript?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:11:52

Timezone handling is an essential component of every web application. The time that is recorded in the backend is usually in UTC format. When it is displayed to the user, however, it must be converted to the user's local time. This is possible with JavaScript. We'll look at how to ... Read More

How to convert string into float in JavaScript?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:10:36

We can convert a string into a float using the parseFloat() function or the Number() constructor in JavaScript. Other approaches such as using + operator, eval() and parseInt() methods, can also be used for this. Converting strings to floating point numbers is a typical operation in JavaScript. This is required ... Read More

Advertisements