How to manually trigger the click event on a button that I pre-connected using jQuery?
Use a trigger. (link to trigger documentation)
$("button:first").click(function () { update($("span:first")); }); $("button:last").click(function () { $("button:first").trigger('click'); update($("span:last")); }); function update(j) { var n = parseInt(j.text(), 10); j.text(n + 1); }
One way to do this:
$ ('# pSearch') press () ;.
pSearch is the identifier of the button I want to click.
You can use the id or class name as a selector to select an item
Then you can do it as below
$ ("class name.") Press the button () ;.
$ ("# ID") click the button () ;.
it works with me and you can try it in the Chrome console
Source: https://habr.com/ru/post/902556/More articles:Normal vs Cloud / Azure Hosting and the role of SQL Azure vs SQL Server - sql-serverProgrammatically UIToolbar below - iosSocket server with epoll and threads - cHow to display Eclipse IDE quick pick suggestions? - javaNoSql file database? - phpWhy do operators after returning change the return value? - c ++Programmatically create a UIToolbar with a standard height - iosSet absolute error in textarea in IE - cssSubmit MVC actionresult to printer - javascriptFirefox / IE textarea sizing quirk - workarounds? - htmlAll Articles