
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 6710 Articles for Javascript

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

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

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

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

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

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