Home  >  Article  >  Web Front-end  >  Use jquery to set focus_jquery in ie for input and textarea

Use jquery to set focus_jquery in ie for input and textarea

WBOY
WBOYOriginal
2016-05-16 19:04:11780browse

Today when we were doing our form submission part, we encountered this problem, so we can solve it with the legendary jquery.
The main topic here is the issue of focus under IE, because it is supported in firefox

Copy code The code is as follows:

input:focus
textarea:focus

Under IE: focus is invalid, so we need to add new styles to the input and textarea after clicking to cooperate with the :focus effect.
Let’s take a look at the effect first:
Look at the JS in this effect:




CSS is defined here:
input,textarea {border: 1px solid #CCC;}
input:focus,textarea:focus{background:#FFFFF7;}

This is a very simple application of jquery, I am also a beginner, please share with me.. .
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn