Jquery prototype.js在这里使用invoke语句做什么?

Jquery prototype.js在这里使用invoke语句做什么?,jquery,prototypejs,Jquery,Prototypejs,我正在将一些prototype.js重构为jquery,我遇到了一些我不完全理解的代码 var form = this.up('form'); form.select('select').invoke('setValue', ''); form.submit(); invoke('setValue','')在做什么?下面是我用来替换jQuery的代码 var $this = jQuery(this); var $form = $this.closest('form'); $form.find(

我正在将一些
prototype.js
重构为
jquery
,我遇到了一些我不完全理解的代码

var form = this.up('form');
form.select('select').invoke('setValue', '');
form.submit();
invoke('setValue','')在做什么?下面是我用来替换jQuery的代码

var $this = jQuery(this);
var $form = $this.closest('form');
$form.find('select').val('');
$form.submit();

但是我不能肯定
.val
是否也在做同样的事情?我想知道是否有人能给我一些指导?

Invoke将相同的方法(使用相同的参数)应用于数组或其他可枚举容器中的多个元素。

让我们看看文档:,