Possible to scroll caret into view inside a single HTML text field with JavaScript?

前端 未结 6 665
心在旅途
心在旅途 2021-02-04 03:41

Knowing the jQuery Caret plugin, I\'m still seeing no way to do the following on a single line text box in HTML (i.e. the input:type=text control) with JavaScript:<

6条回答
  •  借酒劲吻你
    2021-02-04 04:14

    So with the help of Mark and Rob W, I finally managed to solve it.

    My additional challenge was that the text box already has the focus, which came out is an issue (I'm using the whole stuff in the OnClientItemSelected of the Ajax Toolkit's AutoCompleteExtender).

    So my solution is:

    
    

    It's working for me successfully in Google Chrome, Firefox and Internet Explorer 9. Hopefully it works in other browsers, too.

    I'm marking Mark's comment as the answer.

提交回复
热议问题