- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7038 Articles for Javascript
46 Views
JavaScript is a famous programming language that is one of the core languages of the World Wide Web (WWW) alongside HTML and CSS. It allows the programmer to capture events and modify the Document Object Model (DOM). In this article we are going to see how we can make use of JavaScript to change the background color according to the location of the mouse cursor. Mousemove Event The mousemove is an event which gets fired at an element when the cursor of the mouse is moved, and it is still inside the element of concern. It gives us information about ... Read More
24 Views
jQuery is a JavaScript library created to make event handling, CSS animation, Ajax, and DOM tree navigation and manipulation easier. In this article we are going to see how we can change the name of an element using jQuery. Algorithm We are going to follow a three−way procedure to change the name of any element using jQuery: Identify and select the element we want to change. Copy all the attributes of the selected element to a temporary object. Create a new element with the new name and copy all the attributes to it. Replace the old element with this ... Read More
33 Views
JavaScript is a famous programming language that is one of the core languages of the World Wide Web (WWW) alongside HTML and CSS. It allows the programmer to capture events and modify the Document Object Model (DOM). In this article we are going to see how we can make use of JavaScript to change the text of the button whenever it is clicked with the help of localStorage. localStorage The localStorage is a read−only property of the window interface that allows the user to store data. The saved information is kept between browser sessions. The localStorage property is like sessionStorage, ... Read More
17 Views
JavaScript is a famous programming language that is one of the core languages of the World Wide Web (WWW) alongside HTML and CSS. It allows the programmer to capture events and modify the Document Object Model (DOM). In this article we are going to learn how we can catch all JavaScript errors and send them to the server. What is onerror? onerror is an event that is fired whenever an error occurs while loading an external file or resource or some error occurs while executing a script. Syntax onerror = (event, source, lineno, colno, error) => {}; Parameters: The ... Read More
13 Views
JavaScript is a famous programming language that is one of the core languages of the World Wide Web (WWW) alongside HTML and CSS. It allows the programmer to capture events and modify the Document Object Model (DOM). In this article we are going to see how we can catch ReferenceError with the help of onerror event. What is ReferenceError? A ReferenceError is a form of error that may occur when the program tries to access a variable or object that doesn't exist. This can occur when a variable's name is spelled incorrectly or when the user attempts to access an ... Read More

22 Views
In this tutorial, we will look at two approaches to change the image color randomly using HTML, CSS and JavaScript. Approach 1: Using Math.random() Function We will begin by writing the HTML code and use the tag to select the target image. Then we will apply some basic some basic styles using CSS properties. In order to select colors randomly, we have to use the JavaScript Math.random() function. Math.random() generates a number at random between 0 (inclusive) and 1 (exclusive). To change the color of the image, we will use event listeners. The event listener is used to change ... Read More

28 Views
In this tutorial, we will create a stopwatch with the functionality of start, stop and reset, using HTML, CSS, and JavaScript. We'll start by creating the stopwatch's user interface with HTML and CSS. Then, using JavaScript, we'll make the user interface functional. Creating a User Interface for the Stopwatch The first step is to make a single container that contains all of the elements. Further, we proceed to add two divs inside this container, one containing all time elements such as an hour, minutes, seconds, and milliseconds and the other div containing three buttons for the start, ... Read More

19 Views
A HTML form is a section of a document that includes controls like text fields, password fields, checkboxes, radio buttons, a submit button, menus, and so on. It allows the user to enter any data like name, email address, password, phone number, and so on that will be sent to the server for processing. HTML forms are required if we want to collect information from site visitors. The syntax for creating a form is given below. --form elements— ExampleHere is an example showing a simple form with its default behavior. Example ... Read More

24 Views
The onclick event generally occurs when the user clicks on an element. It enables the programmer to run a JavaScript function when an element is clicked. This event can be used to validate a form, display warning messages, and much more. This event can be added dynamically to any element using JavaScript. Except for , , , , , , , , , , and , it supports all HTML elements. In HTML, we can use the onclick attribute and associate it with a JavaScript function. For greater flexibility, we can also use JavaScript's addEventListener() method and pass a click ... Read More

38 Views
Nowadays, validation of mobile number input is a required feature for any application, and it requires validation of the length of the mobile number. Many apps use the mobile number for authentication purposes, sending OTP to users' mobile numbers for successful authentication. If the user enters the wrong mobile number, the app can face issues with sending OTP. So, before the user submits the mobile number for registration or authenticates the app, our app should validate the length of the mobile number. This tutorial will teach us various approaches to validating a mobile number using ReactJs. Before we start, users ... Read More