I made a simple javascript translator using google API. Instead of using a button to translate the text i made onKeyUp=”doTheFunction()” so that it translates once you type. At the bottom I have a button which clears the textareas. Once you clear the textareas and start typing again I get nothing. It seems that something like reset is missing ?
Here is a working fiddle: http://jsfiddle.net/5eC49/
Try to type Hello, press the button and type hello again?
Thanks alot
I would suggest setting .value rather than innerHTML when setting the translation result. Clear is setting value to ”, but when the translation comes back, you’re setting innerHTML instead of value. Apparently that is confusing the browser.
Works for me here: http://jsfiddle.net/jfriend00/WZmSa/