I have the following HTML:
<input type="text" id="endDateEditBox" value="" style="margin-left:5px; height:18px; width:70px; vertical-align:middle;" onchange="validateDate('endDateEditBox', $(dateFormatErrorString).value)">
And I am trying to make this focus using the following Javascript:
document.getElementById("endDateEditBox").focus();
Which chrome console and Firebug both return as undefined. I feel like I am missing something very obvious here, can anyone help?
The
focus()method does not return a value. It sets the focus on the matched input, and then returnsundefined…