javascript - 如何使用javascript调用按钮点击事件背后的代码

标签 javascript jquery

是否可以使用 javascript 或 jquery 调用服务器端按钮单击事件 如果是那么怎么做

最佳答案

假设这是您的 html:

<input type="button" id="button" value="btn" />

在 jquery 中,你调用按钮的点击如下:

$("#button").click();   //button is id

在 javascript 中:

document.getElementById("button").click();

关于javascript - 如何使用javascript调用按钮点击事件背后的代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14156327/

相关文章:

php - 执行时在 php 文件中收到通知

javascript - Backbone.js 模板示例

javascript - Ccombine test with null and undefined vars

javascript - 防止我自己的网站设置(第 3 方)cookie

Javascript 滚动 Div 循环

javascript - 如何将对象列表传递给 Controller ​​?

javascript - 更改 bootstrap 4.2 轮播持续时间

javascript - JSON 文件中的特殊字符转换

php - 数据表 : How to make a page load faster?

javascript - 当滚动条@bottom时使用JQuery使DIV宽度为100%