Search code examples
javascriptjqueryhtmlcss

hide keyboard on ios device when focus in input


I want hide virtual keyboard on ipad device when some plugin ( or other code) set focus to input element on html page using pure javascript( or jquery library)


Solution

  • If you need a pure solution, use this line :

    document.activeElement.blur();
    

    This line removes the focus on the active element and hiding the keyboard.


    Reference