Check Active Tab Using Material-UI

Shubham Vora
Updated on 16-Feb-2023 15:50:06

3K+ Views

Material-UI provides a variety of components that help us to build user interfaces with a consistent look and feel. One of the components that Material-UI provides is the Tabs component, which allows us to create tabbed interfaces in our applications. In this tutorial, we will learn how to check which tab is active using Material-UI, a popular React UI library. Use the useState hook to check which tab is active Users can follow the steps below to check which tab is active using Material UI. Step 1 − First, users need to install Material-UI. We can do this by ... Read More

Difference Between DL and CR Batteries

Md. Sajid
Updated on 16-Feb-2023 15:48:15

3K+ Views

Batteries are a critical component of many devices and machines, from laptops and phones to cars and industrial machinery. But not all batteries are created equal; they come in different shapes, sizes, and technologies. Two of the most common battery types used today are DL and CR batteries, so it’s important to understand the difference between them. In this blog post, we will be looking at the essential facts about DL and CR batteries – including their composition, applications, cost considerations, and more – so you can make an informed decision on which type is right for your needs. ... Read More

Create Half of the String in Uppercase and the Other Half in Lowercase

Shubham Vora
Updated on 16-Feb-2023 15:47:47

2K+ Views

To convert strings into lowercase and uppercase, we can use the JavaScript string class’s built-in methods like toLowerCase() and toUpperCase(). Furthermore, we can use the string length property or substring() method to split the string in half part. We will learn two approaches in this tutorial to convert half string to uppercase and the other half to lowercase using JavaScript. Use the for-loop, toUpperCase(), and toLowerCase() method We can use the for-loop to get the half-string. After that, we can use the toUpperCase() method to convert the first half of the string the uppercase. After that, we need to use ... Read More

Clear Canvas Using clearRect in HTML

Shubham Vora
Updated on 16-Feb-2023 15:45:57

581 Views

We will cover the process of creating a canvas element in the HTML document, selecting it in JavaScript code, and using the clearRect method to clear the entire canvas or a specific area of it. This is a useful technique for creating dynamic and interactive graphics in HTML, and we will walk user through the steps needed to implement it in your own projects. In this tutorial, we will be discussing how to clear the canvas using the clearRect method in HTML. Clearing Canvas with clearRect Users can follow the steps below to clear the canvas using clearRect Step 1 ... Read More

Highlight Dropdown Options in ReactJS

Shubham Vora
Updated on 16-Feb-2023 15:43:53

909 Views

Highlighting dropdown options is important because it improves the menu's usability by making it easier for users to identify the options they are hovering over. When a user hovers over an option, it becomes highlighted, making it stand out from the other options. This helps the user quickly identify the option they are interested in and select. Additionally, highlighting dropdown options is a simple but effective way to improve the usability and accessibility of the menu. Creating interactive dropdown menus in ReactJS with option highlighting Users can follow the steps below to implement the option highlighting in the ReactJS dropdown. ... Read More

Getting Started with React Native

Shubham Vora
Updated on 16-Feb-2023 15:38:15

519 Views

React Native is a framework that allows developers to build mobile applications using JavaScript and React. It allows developers to use the same codebase for both iOS and Android platforms, making it a cost-effective and efficient solution for mobile development. React Facebook first introduced native in 2015 as an open-source project. It is based on React, a JavaScript library for building user interfaces, and allows developers to build mobile apps that look and feel like native apps. Use these tools and resources to build React Native app There are two main ways to install and set up a React Native ... Read More

Get Requests Using AJAX with Custom HTTP Library

Shubham Vora
Updated on 16-Feb-2023 15:35:28

249 Views

We will learn to make a get request using the AJAX by making the custom HTTP library. Let’s learn about the Get request and AJAX before we start with the tutorial. The Get request is used to get or fetch data from the API (Application programming interface). The AJAX stands for Asynchronous JavaScript and XML. The AJAX allows us to load or update new data without reloading the webpage. For example, if you have ever worked with ReactJs, it updates the data without reloading the webpage. If we reload the webpage whenever data updates, it can give a bad user ... Read More

Use Checkbox Inside Select Option Using JavaScript

Shubham Vora
Updated on 16-Feb-2023 15:33:06

8K+ Views

Sometimes, we require to use the checkbox inside the select option. We can allow users to select multiple options by introducing the checkboxes with the select option. However, if we use the multiple attributes with the tag, it allows us to select them by pressing the ‘ctrl + left click’, but it is a bad UX. So, we can introduce the checkbox inside the menu to improve the user experience. Here, we will use JQuery and JavaScript to manage the values of the checked checkboxes in the menu. Create a custom select menu The element of ... Read More

Use Await Outside of an Async Function in JavaScript

Shubham Vora
Updated on 16-Feb-2023 15:31:59

2K+ Views

In JavaScript, the async-await keyword is used to make the function asynchronous. If we make any function asynchronous, it works like multithreading and executes the code parallelly, which helps us to improve the application performance. Here, we will learn to use the await keyword outside the asynchronous function. Invoke the function immediately We will use the expression in this approach to invoke the function immediately. We can use the await keyword with the promises or any other function inside the function. Syntax Users can follow the syntax below to use the function expression to invoke the function immediately. (async () ... Read More

Calculate Minutes Between Two Dates in JavaScript

AmitDiwan
Updated on 16-Feb-2023 15:31:26

12K+ Views

In this article, you will understand how to calculate minutes between two dates in JavaScript. The Date object works with dates and times. Date objects are created with new Date(). JavaScript will use the browser's time zone and display a date as a full text string. Example 1 In this example, we use a function to find the time difference. function minutesDiff(dateTimeValue2, dateTimeValue1) { var differenceValue =(dateTimeValue2.getTime() - dateTimeValue1.getTime()) / 1000; differenceValue /= 60; return Math.abs(Math.round(differenceValue)); } dateTimeValue1 = new Date(2020, 12, 12); console.log("The first date time value is defined ... Read More

Advertisements