Mootools: Get Textbox Text on Keydown Event

1.1k views Asked by At

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?

1

There are 1 answers

1
lorenzo-s On BEST ANSWER

Just use keyup event instead :)

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

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

});