Setting cursor blinking automatically on ui-autocomplete-input before input is selected jQuery

Viewed 185

can somebody help how to set cursor blinking automatically on ui-autocomplete-input of jQuery before input is selected. I went through documentation https://api.jqueryui.com/autocomplete/ but didn't find the answer. I found only this $( ".selector" ).autocomplete( "search", "" ); that automatically triggers the search(select option list), but I only need cursor blinking without triggering select option list.

1 Answers

using javascript (jquery):

$(element).focus(); //you can use $("textarea") for a more generic 
//do autocomplete stuff after

(if you're using autocomplete on pageload) using pure html:

<input type="text" id="fname" name="fname" autofocus>
<!--the "autofocus" makes elements come in focus on page load-->

*Specifics on w3school and on Stackoverfow

*This is hacky! :)
*Only keeps one element on focus at a time.

Hope I could help!

Related