Let define a textfield using API function:
CreateHindiTextBox("id1");
Above will create text box with name and id as "id1".
Let say you want to access the text from above text box. Use below code inside JavaScript Function.
var textBox= document.getElementById("id1");
var hindiText="";
if(textBox!=NULL)
{
hindiText=textBox.value;
}