Mootools:获取Keydown事件的文本框文本

Mootools: Get Textbox Text on Keydown Event

本文关键字:文本 事件 Keydown 获取 Mootools      更新时间:2023-09-26

如何在keydown事件处理程序中获取文本框的当前文本。调用元素.get('value')返回事件发生前文本框中的文本。如何在事件处理程序中获取当前值?

只需使用keyup事件:)

$('yourTextarea').addEvent('keyup', function() {
    var value = this.get('value');
    console.log('value');
});