简体   繁体   中英

How do you submit a form with javascript with a <input type=“button”>

How would you use a div to submit a form, for example? Javascript please

像这样:

document.getElementById("ID of form element").submit()

I have an onchange event attached to a dropdown that does:

this.form.submit();

It's used on an internal utility, so I'm not sure if there is a cross-browser issue, but it's great on IE 7, firefox 3.x, and safari.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM