I am using a text box tagsinputon my website from project .
And I'm trying to set focus on the text box, but it does not work. This gives me the following error:
Unhandled exception at line 37, column 9 in
LOCALDOMAIN-LINK-REMOVED
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'focus'.
line (37)to which this error relates is:
searchQueryTB.focus();
My full code is:
document.onload = FocusSearchQueryTextBox();
function FocusSearchQueryTextBox() {
var searchQueryTB = document.getElementsByClassName("TBhandle0F7X");
searchQueryTB.focus();
}
Markup:
<input type="text" value="" name="SearchQuery" id="tagsinput" class="TBhandle0F7X" />
So, I assume this may have something to do with the fact that maybe the text field is actually not proper textfieldin that it is the jQuery user interface alone or something that is used in the project tagsinput? Or maybe I'm wrong, but so far I have not had any luck on Google, and there seems to be nothing to do with this problem on the project website.
jQuery, , , . .
, ?