Found 6710 Articles for Javascript

What is onmouseenter event in JavaScript?

Nishtha Thakur
Updated on 19-Jun-2020 11:06:58

323 Views

The onmouseenter event triggers when you mouse hover the pointer.ExampleYou can try to run the following code to learn how to work with onmouseenter event in JavaScript −                                         This is demo text for mouseenter event.    

What is onmousedown event in JavaScript?

varma
Updated on 19-Jun-2020 11:04:27

475 Views

The onmousedown event triggers when a mouse button is pressed.ExampleYou can try to run the following code to learn how to work with onmousedown event in JavaScript −                                         This is demo text. The onmousedown event triggers when a mouse button is pressed    

What is ondblclick event in JavaScript?

Smita Kapse
Updated on 19-Jun-2020 11:05:15

381 Views

Use the ondblclick event to generate an event on double click.ExampleYou can try to run the following code to learn how to work with ondblclick event in JavaScript −                                         Double Click me    

What is oncontextmenu event in JavaScript?

usharani
Updated on 19-Jun-2020 11:03:46

445 Views

On right click of an element, when the context menu opens, then it is known as oncontextmenu in JavaScript.ExampleYou can try to run the following code to learn how to work with oncontextmenu event in JavaScript −                                         Right click    

How to add hours and minutes to a date with JavaScript?

Saurabh Jaiswal
Updated on 22-Aug-2022 08:06:32

12K+ Views

In this tutorial, we will learn how to add hours and minutes to a date with JavaScript. We have multiple methods to achieve this which are the following. Add hours using the setHours() Method. Add minutes using the setMinutes() Method. Add hours or minutes with the getTime() Method. Add hours using the setHours Method JavaScript date setHours() method sets the hours for a specified date according to local time. Syntax Following is the syntax to apply the setHours() method to add hours to date − Date.setHours(hours, minutes, seconds, ms) Note − Parameters except the first one are ... Read More

How to submit an HTML form using JavaScript?

Abhishek
Updated on 25-Nov-2022 06:57:15

18K+ Views

In this tutorial, we will learn how we can submit an HTML form using JavaScript. To submit an HTML form using JavaScript, we are calling validate() to validate data when the onsubmit event is occurring. We will discuss the direct method of submitting the HTML form as well as the method which checks that none of the fields is empty. Both of these methods are listed below − Using the Form submit() Method Using the manual validations Let us discuss both of these methods in detail in code examples associated to each. Using the Form submit() Method The ... Read More

How to convert seconds to HH-MM-SS with JavaScript?

Shubham Vora
Updated on 17-Aug-2022 12:38:30

4K+ Views

In this tutorial, we will learn to convert seconds to Hours, Minutes, and Seconds (HHMM-SS) format in vanilla JavaScript. The date and time are an integral aspect of our daily lives; date and time are frequently used in computer programming. You might need to write a website in JavaScript with a calendar, a rail schedule, or an interface for scheduling appointments. So, for such purposes, JavaScript provides us with some inbuilt functions like the getTime() returns the number of milliseconds since January 1, 1970, 00:00:00. Using the toISOString() Method We might need to put seconds into a well-formatted structure to ... Read More

How can we debug JavaScript in Internet Explorer?

Srinivas Gorla
Updated on 19-Jun-2020 08:59:04

199 Views

The most basic way to track down errors is by turning on error information in your browser. By default, Internet Explorer shows an error icon in the status bar when an error occurs on the page. Double-clicking this icon takes you to a dialog box showing information about the specific error that occurred. Since this icon is easy to overlook, Internet Explorer gives you the option to automatically show the Error dialog box whenever an error occurs. To enable this option, select Tools → Internet Options → Advanced tab. and then finally check the "Display a Notification About Every Script Error" box option as ... Read More

How can we debug JavaScript using Firefox?

Shubham Vora
Updated on 30-Aug-2022 07:02:27

3K+ Views

In this tutorial, we will learn to debug the JavaScript code using the Firefox web browser. Generally, we debug the code to fix the unknown bugs and errors. Mostly it happens with beginner programmers, code works successfully until the last night and suddenly crashes in the morning Programmers don’t need to worry now, even if code crashes. Once you learn to debug the code, you can fix any bugs in a few minutes and make it work fine If users want to learn to debug the code, the first step is to produce the code example with the error. So, ... Read More

How to do basic form validation using JavaScript?

Vrundesha Joshi
Updated on 19-Jun-2020 08:56:24

728 Views

JavaScript provides a way to validate form's data on the client's computer before sending it to the web server. Basic form validation includes the form to be checked to make sure all the mandatory fields are filled in. It would require just a loop through each field in the form and check for data.ExampleYou can try to run the following code to implement basic form validation in JavaScript −           Form Validation                // Form validation          function validate(){             if( document.myForm.Name.value ... Read More

Advertisements