Lets say there is a form with a submit button. I found out that using javascript i can call the click() method for input elements in Firefox which would simulate the mouse click on that element.
But then, i got this question, can you detect if button was clicked with real computer mouse, or .click() method?
Thank you
You can trigger a test using
onmousedownfrom the element in question.Keep in mind the following though:
type="submit", you can use the same function that envokes.click()to just submit the form like ~formName.submit();type="button"and for some reason you have an onclick event handler that submits the form, your onclick events will be invoked whether you call.click()or actually click the button..click().