views:

18

answers:

2

I have one text box immediately after that one button. If i click on that button dynamically i get one more text box, but the focus is not coming to new text box. Can any one suggest something.

Thanks in advance Venkat

+2  A: 

You need to execute element.focus() on the new texbox after its insertion to give it focus.

E.g.

var element = document.getElementById('newElementId');
element.focus();

Also available in jQuery

$('#newElementId').focus();
BalusC
A: 

Thank you for the quick response, i got it resolved.

venkat