javascript - focus isnt working for text field -


source ->

<input name="ctl00$maincontent$mapusercontrol$6551_edit_artintheparkssculpturelocations_32_id" type="text" maxlength="50" id="ctl00_maincontent_mapusercontrol_6551_edit_artintheparkssculpturelocations_32_id" onchange="maxlength(50, this, 'id')" class="control-label form-control" id2="6551_edit_artintheparkssculpturelocations_32_id"> 

i can update text in field

x = document.getelementbyid('ctl00_maincontent_mapusercontrol_6551_edit_artintheparkssculpturelocations_32_id') x.value ="bla"; 

however can't update focus...

x.focus(); 

returns undefined expected nothing happens text field. have tried autofocus, , grabbin element jquery instead of js.... still no joy...any idea why?

have faced similar issue. calling focus through settimeout need.

settimeout(function() { x.focus()}, 1); 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -