简体   繁体   中英

submit button with no text or form name attribute

could someone help me with this question?

in JavaScript, we can use "document.HELLO.submit();" submit a form if the form name is HELLO. but i meet a case there's a button on webpage (the button itself doesn't have any text), has no form name found.

in what way in JavaScript i can simulate the submit action to this button?

thanks.

采用

document.forms[0].submit();

您可以通过调用document.getElementsByTagName("form")获得所有<form>元素的数组。

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