Please, help me with this problem with jQuery, event and textarea
I'm using Google Translate API
-
- function initialize() {
- var content = document.getElementById('text-input');
- google.language.translate(document.getElementById('text-input').innerHTML, 'es', 'en', function(result) {
- if (!result.error) {
- var translated = document.getElementById("text-output");
- if (result.translation) {
- translated.innerHTML = result.translation;
- }
- document.getElementById("text-output").innerHTML = translated.innerHTML;
- }
- });
-
- }
-
- $("text-input").live('keyup', initialize);
- --------------
-
- <textarea name="output" id="text-output"></textarea>
-
The idea is after write in text-input textarea it shows result in text-outpu, I'm using keyup event for that, but it doesn't work It's necessary to use other jQuery keybord event? Is it correct to use tha jquery and textare like I coded? Plz, help me!