Found 6685 Articles for Javascript

How to remove “disabled” attribute from HTML input element using JavaScript?

Shubham Vora
Updated on 17-May-2023 12:07:38

3K+ Views

In HTML, we can use input elements to take input from the users by creating a form or in any other way. There are different types of input elements, such as checkboxes, radio buttons, text, numbers, etc. We can use the ‘disabled’ property with every element to disable the input field and stop users from interacting with the input element. In some cases, we require to add and remove the disabled attribute using JavaScript. For example, we want to take the pan card numbers of the users whose age is greater than 18. So, we require to enable the ... Read More

How to read all spans of a div dynamically?

Shubham Vora
Updated on 17-May-2023 12:02:03

740 Views

One HTML element can contain multiple nested HTML elements while creating web pages. In some cases, developers may require to read the particular HTML elements of one HTML element. In our case, we require to read all span elements of the div element and extract the content of them. In this tutorial, we will learn to read the content of all spans of a div element using JavaScript and again append it to the web page in the formatted way. Syntax Users can follow the syntax below to read all spans of a div element dynamically using JavaScript. var spans ... Read More

How to play a notification sound on websites?

Shubham Vora
Updated on 17-May-2023 11:31:23

5K+ Views

Nowadays, web development continues to evolve and find new ways to improve the user experience. One way to improve the user's experience is by adding notifications to the website to notify users of any event. Before we start with the tutorial, let’s understand why we need notifications with sounds on the website. Why Add Notification Sounds? As we said above, notification is used to enhance the user experience. We can use it to notify users for a task, such as when users completes the form submission, get a message in the chat app, for reminders, etc. If users are away ... Read More

How to place cursor position at end of text in text input field using JavaScript?

Shubham Vora
Updated on 17-May-2023 11:23:40

8K+ Views

In HTML, the input field is used to take input from the users. Sometimes, we require to take string or long text messages in the input. In these scenarios, users may need to go to the end of the input field to add more content or message. So, we should set up something such that users can click the button, can go to the end of the input field. In this tutorial, we will learn to use JavaScript to place the cursor position at the end of the text in the input field. Using the setSelectionRange() method The setSelectionRange() method ... Read More

A Game Using Javascript – Fire the bullets

Saba Hilal
Updated on 10-May-2023 17:01:18

328 Views

This game is made using JavaScript and the game lab of code.org. The game Story/Rules/Intrroduction The player has to move the commando by pressing the UP, DOWN, LEFT and RIGHT arrow keys and make the commando escape the walled area. To go out of the door the commando needs to find the right key. One of the key is of the door. The keys are placed in the protected area. The commando needs to reach the door while picking the right key. Lots are fire tanks are seen in the walled area. If the commando is in range of any ... Read More

How to Create an Animated Typing Effect using typed.js

Aman Gupta
Updated on 09-May-2023 17:00:08

3K+ Views

Overview Typed.js is an animation library supported by java script and other scripting languages. It provides the typing animation effect to the text. We can use this library by adding the CDN link of the library or by installing it using node package manager (NPM) or yarn. It gives a webpage with the typing animations in any paragraph or headings. So to know more about the typed.js typing animation effect. To use the animation the types.js provides a constructor named as typed() which takes two arguments as input. Syntax The syntax used to create the object of the constructor types ... Read More

Which One is Better for Game Development—Python or JavaScript?

Tushar Sharma
Updated on 08-May-2023 13:42:39

1K+ Views

Aspiring game developers often face the dilemma of choosing the right programming language for their projects. Two popular contenders in the game development realm are Python and JavaScript. In this article, we will delve into the strengths and weaknesses of each language, discuss their suitability for different types of games, and ultimately help you determine which language is the better choice for your game development journey. Python: The Versatile Giant Python has earned its reputation as a flexible, beginner-friendly language with a wealthy ecosystem of libraries and systems. Its rich syntax, lucidness, and ease of utilization have made it a ... Read More

How to make a word count in textarea using JavaScript?

Saba Hilal
Updated on 04-May-2023 17:04:27

1K+ Views

Sometimes, the task is to count the words entered in an input box or a text area. The textarea is often used if we want to show multiple lines of text. While entering the text into the text area, the user may use blank spaces as the separation between the words or between lines. Using HTML, and javascript code with Jquery library, this process of counting the words in the entered text is demonstrated in this article. This is shown by using two different examples. In the first example, the blank spaces or newlines entered are counted, to find the ... Read More

What is the App Shell Model in JavaScript?

Shubham Vora
Updated on 04-May-2023 16:59:13

300 Views

The App Shell Model is a design pattern that keeps a web app's UI and data modules apart. Caching the user interface in this design may load content on the fly. This method is widely utilized in progressive web apps (PWAs) because of its many speed and user experience benefits. Benefits of the App Shell Model in JavaScript Faster Load Times The user experience is enhanced by reducing the time it takes for the program to load for the first time due to caching the app shell. Users have come to anticipate instantaneous response times from online apps, and any ... Read More

How to create a reporting app with Vue 3 and Composition API?

Shubham Vora
Updated on 04-May-2023 16:58:27

530 Views

Vue is a JavaScript framework that allows developers to create web applications. It is mainly used to build single-page web applications. There are lots of benefits to using the vue to create web applications, such as easy structure, lightweight, component-based architecture, etc. Before we start with the tutorial, let’s learn about the reporting app and composition API. The reporting app is a single or multiple-page web application that displays useful data in a proper format, such as table format. It is used to show the reports of the data in a particular format. The composition API allows developers to code ... Read More

Advertisements