How to realize input frame to get focus by jquery
This article introduces the knowledge of "how to achieve the focus of the input box by jquery". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Get a simple example of form focus discoloration
/ / .login-form form style class / / .item input input box parent div// focus is the style class $(".login-form") .on ("focus", "input", function () {$(this) .closest ('.item'). AddClass ('focus');}) .on ("blur", "input", function () {$(this) .closest (' .item') .removeClass ('focus');}) / / initialize the user name input box $("# itemBox") .find ("input [name=username]") .focus (); this is the end of the content of "jquery how to achieve the focus of the input box". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!