无法使用jquery触发mousedown事件

我正在尝试使用jquery在http://translate.google.com中模拟点击事件。 为此,我用这段代码加载了jquery文件:

var script = document.createElement("script"); script.src = "http://code.jquery.com/jquery-1.10.1.min.js"; document.body.appendChild(script); 

然后我试图用选择器模拟对元素的点击,如下所示:

 jQuery(".goog-inline-block.goog-flat-menu-button-caption").trigger("mousedown") 

我也试过这个点击事件而不是mousedown:

 jQuery(".goog-inline-block.goog-flat-menu-button-caption").trigger("click") 

它们都没有给出手动点击div的效果,即打开一个新的div。 我附上了所需行为的ss。

点击状态

jquery无法工作的原因是什么? 或者我如何以其他方式模拟效果?

编辑:添加jQuery似乎是成功的,因为我可以使用jQuery方法来选择元素并更改它们的内容等。

解决方案是创建一个MouseEvent并将其分派给元素,如下所示:

 var e1 = document.createEvent("MouseEvents"); e1.initMouseEvent("mousedown", true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); jQuery('#gt-sl-gms')[0].dispatchEvent(e1) 

似乎jQuery的事件机制使用不同的调度系统,因为它不能触发监听器function,尽管我没有确认这个信息。