문제

How can I get the current text of a textbox in the keydown event handler. Calling element.get('value') returns the text that was in the textbox before the event happened. How can I get the current value in the event handler?

도움이 되었습니까?

해결책

Just use keyup event instead :)

$('yourTextarea').addEvent('keyup', function() {

    var value = this.get('value');
    console.log('value');

});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top