How do I select the submit button of the second form on a webpage?
Am I able to able to submit said form by using the .click() function on the selected submit element?
This is the script I am using in attempt to do so currently:
function Ellipsis_Mouse_Click()
{
$("form:eq(1):submit:eq(0)").trigger('click');
}
To select the second form:
.eq()works from a zero-based index, hence using.eq(1)instead of.eq(2).This isn’t a particularly good way of selecting the form as it’s vulnerable to any DOM changes (whether made manually or with more JS). Consider adding a class or ID to the form, or select it relative to a container that has a class or ID.
To submit the form:
You don’t need to find the submit button and trigger a
clickon that. Instead, you can just call.submit()on the form itself.