Shubham Vora has Published 962 Articles

How to update mouse location when scrolling with jQuery?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:57:59

1K+ Views

In jQuery, we can trigger the ‘mousemove’ event to detect the mouse pointer's location on the web page. Also, we can detect the scroll using the ‘scroll’ event and subtract that value from the y position to get the relative mouse location. Using the ‘overflow-y: scroll’ CSS property, we can ... Read More

How to throw an error when using a property of an object?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:55:41

451 Views

In JavaScript, an object contains the properties in the key-value format. We can access any property of an object using the property name by taking the object as a reference. Sometimes, we try to access the object property that doesn’t exist in the object. In such cases, we get the ... Read More

How to throw an error in an async generator function in JavaScript ?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:53:00

1K+ Views

The code often throws an error, and handling errors is more important. JavaScript also allows users to throw a custom error using the ‘throw’ keyword. We can catch the errors in the catch block. We can use the try-catch syntax to catch errors thrown by normal functions. Let’s understand it ... Read More

How to switch the language of the page using JavaScript?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:50:29

7K+ Views

Whenever you develop a website or application for a worldwide business, you must also focus on which language your audience can understand. For example, English is an international language, but in some parts of the world, people don’t understand English as they speak German, Spanish etc. However, if you have ... Read More

How to Style Google Custom Search Manually using CSS?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:47:14

580 Views

Have you ever tried to build a custom search engine? If yes, you are aware of how much effort it takes. The first thing is that we need to create a search algorithm that should show the best matching results when any user searches. It can take a lot of ... Read More

How to store JavaScript functions in a queue and execute in that order?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:45:32

518 Views

Sometimes, developers may require to store the function in the queue and execute it in the order it is stored in the queue. In JavaScript, we can create a queue using the array. We can use the push() method of the array to enqueue the function in the queue and ... Read More

How to store data to DOM?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:42:53

1K+ Views

Storing data in the DOM means storing data in plain text format. For example, we store data in the state variable while using React or any other reactive framework. When the user updates the data in the input field, it stores updated data in the state variable. So, we store ... Read More

How to show/hide div element depending multiple values using Bootstrap and jQuery?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:40:04

3K+ Views

Sometimes, we may require to show and hide div based on the selected values. For example, you want to show the registration or login forms based on the radio button's selected value. Below, we will learn to show/hide the div elements based on the selected value using JQuery. Show/hide the ... Read More

How to show some custom menu on text selection?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:37:29

602 Views

In some text editors, when you select the text, it shows the menu to edit texts and provides functionalities like justifying text, aligning text, increasing the text size, changing colour, etc. Microsoft word is the best example of it. In Microsoft word, when you select any text, it shows the ... Read More

Advantages of CoffeeScript Over JavaScript

Shubham Vora

Shubham Vora

Updated on 04-Apr-2023 12:32:16

174 Views

What is JavaScript? It is a loosely typed language that is mainly used in development. We can use javascript both in frontend as well as backend development. The nature of programs is synchronous and executed line by line. You can run javascript on any system or browser as it contains ... Read More

Advertisements