Found 10710 Articles for Web Development

How to use Grid Component in Material UI?

Rushi Javiya
Updated on 07-Mar-2023 11:41:14

740 Views

The grid means the structure of rows and columns like a table. When we create a table using the HTML tag, we can create every row and column of different dimensions, but the Grid component of the Material Ui library allows us to do so. We can use the Grid component of the Material UI as a container and item. Also, we can adjust the grid automatically according to the dimensions of the device screen. Users first need to install the Material Ui library to use the Grid component in the React project using the below command. ... Read More

How to check if CSS property is supported in browser using JavaScript?

Aman Gupta
Updated on 07-Mar-2023 11:26:43

2K+ Views

Overview In today's world there are various browsers available on the system. So sometimes there are certain Cascading Style Sheets (C.S.S.) property that does not run on that browser. So to check which CSS properties are supported for that specific browser, JavaScript has the in-built method CSS.supports(), which checks whether that specific property is supported by the browser or not. The supports() method is supported by all the browsers: Opera, Edge, Chrome, and Firefox. Syntax The CSS.supports() method takes a key-value pair as input, which is in String format. The basic syntax used is − CSS.supports(“propertyName:value”); supports() − ... Read More

How to use Fab Component in Material UI?

Rushi Javiya
Updated on 07-Mar-2023 11:34:32

648 Views

The fab component is a short form of the floating action button. You may have seen the floating action button in many Android applications at the bottom right corner. However, it's not fixed that you need to add the floating action button at the bottom right corner, but it is the most used place. Users can use the Fab component of Material UI to create floating action buttons with different icons. To start with the Material UI, execute the below command in the terminal in the React project directory. npm install @mui/material @emotion/react @emotion/styled Syntax Users can ... Read More

How to trigger the setInterval loop immediately using JavaScript?

Rushi Javiya
Updated on 07-Mar-2023 11:16:20

3K+ Views

The setInteral() method allows us to continuously trigger a callback function after every particular time period. We can pass the callback function as the first parameter to trigger after every time period, and the time period in the milliseconds as a second parameter. The setInterval() method invokes the callback function after a particular number of milliseconds for the first time. Now, the problem is we need to invoke the callback function instantly for the first time at 0 milliseconds, and after that, we need to invoke it continuously in the given time period. Example In the example below, we created ... Read More

How to trigger the onchange event on input type=range while dragging in Firefox?

Rushi Javiya
Updated on 07-Mar-2023 11:14:21

8K+ Views

The range input allows a selection of any value between the particular range of values. Using JavaScript, we can get the input value that users have entered in the range input. The onchage event triggers only when the user releases the mouse key. So, it will not update the value while dragging the range slider. You can face this problem in all browsers, such as chrome, safari, but not only in Firefox. Users can follow the example below to check whether the input value is updated while dragging the range input. Example 1 (Input values will not update while dragging ... Read More

How to trigger the HTML button after hitting enter button in the textbox using JavaScript?

Rushi Javiya
Updated on 07-Mar-2023 11:11:05

4K+ Views

Generally, developers add the submit button to submit the input field's text. However, if they allow users to submit the input value by pressing enter, it improves the UX of the application. Here, we will learn the general way to detect the key press using the key listener event. Afterwards, we can perform any operation whenever the user presses the enter key button. Syntax Users can follow the syntax below to detect whenever the user presses the enter key. input.addEventListener("keypress", function (event) { if (event.keyCode == 13) { // enter pressed ... Read More

How to trigger a file download when clicking an HTML button or JavaScript?

Rushi Javiya
Updated on 14-Sep-2023 16:07:01

38K+ Views

Nowadays, many applications allow their users to upload and download files. For example, plagiarism checker tools allow users to upload a document file with some text. After that, it checks for plagiarism and generates a report, and users can download it. Everyone knows to create an upload file button using the input type file, but there are few developers who know to create a file download button using JavaScript/ JQuery. This tutorial will teach various approaches to trigger a file download when clicking an HTML button or JavaScript. Use the download attribute with HTML tag to trigger a file ... Read More

How to splice an array without mutating the original Array?

Rushi Javiya
Updated on 07-Mar-2023 11:05:02

4K+ Views

In JavaScript, we can use the splice() method to splice an array. The splice() method inserts or deletes single or multiple elements from the array. We can pass the starting index as the first parameter of the splice() method, from which we can insert or delete the elements. It takes the number of elements to delete from the array as a second parameter and array values as the third parameter to insert into the array. This tutorial will teach us to splice an array without mutating the original array. Mutating the original array means making changes to the array. Whenever ... Read More

How to Create Horizontal and Vertical Tabs using JavaScript?

Rushi Javiya
Updated on 07-Mar-2023 11:01:08

839 Views

We can create tabs using HTML, CSS & JavaScript. There can be two types of tabs. One is horizontal tabs, and another is vertical tabs. The tabs allow us to show different contents in very less space as we can show the different content according to the different tabs. We will learn to create horizontal and vertical tabs from scratch using HTML, CSS, and JavaScript. Create horizontal tabs We can show all tabs in a single row by creating horizontal tabs. Also, we can show the content of the selected tab below all tabs. Syntax Users can follow the syntax ... Read More

How to create Hamburger Menu for mobile devices?

Rushi Javiya
Updated on 07-Mar-2023 10:55:12

1K+ Views

The hamburger menu icon has three vertical bars, which the navbar uses to expand and collapse the menu on mobile and tablet devices. This tutorial will teach us to create a hamburger menu from scratch. Here, we will use HTML, CSS, JavaScript, and Bootstrap to create a stylish hamburger menu with a navbar. Steps Users can follow the steps below to create a navbar with a hamburger menu icon. Step 1 − Create a div with a container class containing a navbar and an expandable menu. Step 2 − After that, create a div with a header class inside ... Read More

Advertisements