Front End Technology Articles - Page 574 of 652

What is onsubmit event in JavaScript?

V Jyothi
Updated on 19-Jun-2020 11:19:19

4K+ Views

The onsubmit event is an event that occurs when you try to submit a form. You can put your form validation against this event type. The following example shows how to use onsubmit. Here we are calling a validate() function before submitting a form data to the web server. If validate() function returns true, the form will be submitted, otherwise, it'll not submit the data.ExampleThe following example is a code snippet showing the usage of the onsubmit event −                                                  .......                    

What is onkeypress event in JavaScript?

radhakrishna
Updated on 19-Jun-2020 11:18:13

429 Views

The onkeypress event triggers when a key is pressed and released. You can try to run the following code to learn how to work with onkeypress event in JavaScript −Example                                            

What is onkeydown event in JavaScript?

Priya Pallavi
Updated on 19-Jun-2020 11:17:27

428 Views

The onkeydown event triggers when a key is pressed. You can try to run the following code to learn how to work with an onkeydown event in JavaScript −Example                                            

What is onmouseleave event in JavaScript?

Sreemaha
Updated on 19-Jun-2020 11:06:19

320 Views

The onmouseenter event triggers when after the mouse hover is moved out.ExampleYou can try to run the following code to learn how to work with an onmouseleave event in JavaScript −                                         This is demo text for mouseleave event.    

What is onmouseenter event in JavaScript?

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

350 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 oncontextmenu event in JavaScript?

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

508 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 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

250 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

Advertisements