I have two text box one for English another for Hindi, when i type in English on first box, the texts should appear as Hindi version on the second box (on key up event).
You'd want to copy the text from the English field to the Hindi field, and then apply the Google Translate to the Hindi field only. Once the text is copied from the English field, there is no reason to manipulate the English field further. Something like:
document.getElementById("txtEnglish").addEventListener("keyup", translate);
function translate() {
document.getElementById("txtHindi").value = document.getElementById("txtEnglish").value;
}
At which point Google Translate should change the English text in the txtHindi
box to Hindi.
EDIT: You'll also want to change your control.makeTransliteratable(["txtEnglish"]);
to control.makeTransliteratable(["txtHindi"]);
to produce the translation.