10
有没有办法从外部调用调用可取消区域上的“取消”? (而不是点击取消) - 基本上关闭textarea。调用可取消取消
有没有办法从外部调用调用可取消区域上的“取消”? (而不是点击取消) - 基本上关闭textarea。调用可取消取消
它看起来像jeditable直接暴露了用于初始化可编辑部分的DOM元素上的“取消”方法。
例如:
// A paragraph with jeditable initialized like this:
$('p#editable').editable();
// Could be canceled with:
$('p#editable')[0].reset();
另一种选择是触发取消按钮本身的“click”事件。 为了做到这一点,我们可以为取消按钮指定特定的html。
$('p#editable').editable({
cancel: '<button class="cancel_button">cancel</button>'
});
// And to cancel:
$('p#editable').find('.cancel_button').click();
你也可以简单地这样做:
('.your_jedit_class').each(function(){
this.reset()
})