Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

Sunday, March 9

How to Submit Form without Using Submit button in JavaScript

Generally, a form is submitted when the user presses a submit button. However, sometimes, we may need to submit the form without submit button using JavaScript.
JavaScript provides the form object that contains the submit() method. Use the ‘id’ of the form to get the form object.
e.g. if name of the form is ‘f1’, the JavaScript code for the submit call is 

How to add Javascript in HTML

Here i will show you how to use JavaScript on HTML page.JavaScript code can be inserted either in the head of the document (between the <head> and </head> tags) or in the body (between the <body> and </body> tags). However, it is a good idea to always place JavaScript code in the head if you can.