How to get the input element of a text box in sencha

advertisements

How can I get the input element of a textbox by id in javascript? I already tried to search through the divs manually, but that seams unpractical. Since the Id is always a bit random, how do I get it?


first way

  document.getElementById("ur input text box Id").value;

but this will fail if your control in a User control because at run time it will change then try this :

   document.querySelectorAll('input[id$="put your input textbox id here"]')[0].value;

This will sure get you your text box value