Problem when deleting jQuery Mobile TextBox Control

I have created a login form having two jQuery Mobile TextBox Controls, one for the user name and one for the password.
Now I have found that if I delete the userName control and replace it with one jQuery Mobile TextBox with the same id, my code will not work and the orientation of the textbox is destroyed, meaning that instead of appearing at the center of the screen as was initially placed, it appears at the top of the page and extended to the whole width of the page.
On Chrome, I get the error: " Uncaught TypeError: Cannot read property ‘parentElement’ of undefined" at a line of index.html (seen under Chrome Developer) :
uName.parentElement.id = ‘uName_wrapper’;

Any suggestions?

Are there any other errors in the Console?

What it’s say is that there is no control with the id of uName. Either you don’t have one, or more likely, there was a problem creating it, so it does not exist.

ok, found the source of the problem.
I had created a global variable with the same name and there was a sort of conflict between the two entities…
Thanx.

That would do it. The global variable will replace a control with the same name.