Shubham Vora has Published 957 Articles

Implement a JavaScript when an element loses focus

Shubham Vora

Shubham Vora

Updated on 28-Feb-2023 17:33:58

1K+ Views

When we click the input element in HTML, it sets the outline for the input element, focusing on it. Sometimes, we must execute some JavaScript code when the user loses focus from the input element. For example, We can autofocus the input element when the user refreshes the web ... Read More

Image Transition with Fading Effect using JavaScript

Shubham Vora

Shubham Vora

Updated on 28-Feb-2023 17:32:48

6K+ Views

Image transition means changing the image and replacing one image with another. Users can see the image transition in the image slider. While developing the image slider, we should focus on the animation for image transition to make an attractive UX of the application. In this tutorial, we will learn ... Read More

How to create Covid19 Country wise status project using REST API?

Shubham Vora

Shubham Vora

Updated on 28-Feb-2023 17:28:35

361 Views

Before creating the project, we will first discuss REST API. REST is a software architecture style and a collection of standards that helps make online services. Representational State Transfer is the full name of REST. At the same time, Application programming interfaces (API) allow communication between two or more computer ... Read More

How to write shorthand for document.getElementById() method in JavaScript?

Shubham Vora

Shubham Vora

Updated on 28-Feb-2023 17:27:44

1K+ Views

The document.getElementById() method allows us to access any HTML element using its id in JavaScript. Every webpage can contain only a single HTML element with a single id. You can use the below example code to access any HTML element using its id. let element = document.getElementById('id'); In ... Read More

How to write an inline IF statement in JavaScript?

Shubham Vora

Shubham Vora

Updated on 28-Feb-2023 17:23:39

8K+ Views

Conditional statements are the most important and basic concept of any programming language. The if-else statement allows us to execute any code block conditionally. We can define the condition for the if statement in braces, and if the condition becomes true, it executes the code of the if block; Otherwise, ... Read More

How to write a cell phone number in an international way using JavaScript?

Shubham Vora

Shubham Vora

Updated on 28-Feb-2023 17:21:18

655 Views

When you have visitors from worldwide on your websites, it is a good idea to show things like a cell phone number according to international standards. So they can easily understand. We can use the International Public Telecommunication Numbering Format to represent the cell phone number in an international ... Read More

How to wrap setTimeout() method in a promise?

Shubham Vora

Shubham Vora

Updated on 28-Feb-2023 17:20:12

8K+ Views

The setTimeOut() method executes some block of code or functions after a particular number of milliseconds. Sometimes, we require to resolve or reject the promise after a particular delay, and we can use the setTimeout() method with the promises. In JavaScript, a promise is an object that returns the ... Read More

How to wait resize end event and then perform an action using JavaScript?

Shubham Vora

Shubham Vora

Updated on 28-Feb-2023 17:18:50

3K+ Views

Whenever we resize the web page window, it triggers the ‘resize’ event by default. The ‘resize’ event triggers multiple times while resizing the window. Sometimes, we require to execute some JavaScript code only once when resize event completes. In such cases, we must use the setTimeOut() method with the ... Read More

How to view array of a structure in JavaScript?

Shubham Vora

Shubham Vora

Updated on 28-Feb-2023 17:17:38

408 Views

The easiest way to debug the JavaScript code is using the console.log(), which many developers use. Sometimes, we require to know the array's structure and stored values for the debugging purpose. In this tutorial, we will learn to view the array of structures. Various methods of JavaScript allow us ... Read More

How to create refs in ReactJS?

Shubham Vora

Shubham Vora

Updated on 28-Feb-2023 17:14:40

453 Views

In ReactJS, refs are used to referring any node of the document. Generally, we can pass the props to children elements to interact with children from the parent’s state. Still, sometimes the child component is out of the typical dataflow of components. For example, we have four components, and dataflow ... Read More

Advertisements