You can use any attributes like id, name, class, tag name as well to submit form onclick method. it works thanks coding-dude ,can u explain why it worked when id of button is changed?? If I have a form, whic does not have a submit button, but it has a button with an onClick event. In our previous blogs we have explained various ways to submit form using jQuery. match them, Ensure the js code is loaded before the HTML one. A setTimeout() function is then used to reset the button back to its enabled state after two seconds. This was all about different ways of form submission through JavaScript. <input type="button" value="Click me" onclick="msg()"> Try it Yourself . Regex: Delete all lines before STRING, except one particular line, Multiplication table with plenty of comments, Correct handling of negative chapter numbers. So thats why this piece of the onclick event is based on the mouse events because it is triggered whenever the user click some ui tag elements in the web page same page itself the user drag the mouse pointer often they will be dragged the pointer in the entire web page browser the click event occurs once the user clicks on the particular element on the web applications or Easier to style in CSS; as mentioned above, FIrefox and IE have quirks in which input . THe href = the text ToPage.asp. javascript . document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() ); Your email address will not be published. Utterly indited content, Really enjoyed reading through. In this example our button starts off enabled, but if you press it, it is disabled using button.disabled = true. I have a blog centered on the same subjects you discuss and would Does squeezing out liquid from shredded potatoes significantly reduce cook time? I have a mission that Im just now operating on, and I have been on the glance out for such It can be annoying for users who accidentally activate the reset button. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. Note: Firefox will, unlike other browsers, by default, persist the dynamic disabled state of a