javascript - jQuery .focus() and .blur() not working in Chrome or Safari -


I am creating a survey form for which to highlight each question and answer set (by changing the background color) When the user is focused on them. Both Focus (.) And .bore () work in Firefox and IE, but not completely in Safari and Chrome. I also tried. Foccin () and. Focusout (with the same result) Edit: Clicking does not slip the focus event, but tabbing through the input field. I say not completely because it works for text input, select input and texture input; But not radio and checkbox input

  $ (document) .ready (function () {$ ("form li"). Focusin (function () {$ (this) .addClass ("at");}). Focus Out (function () {$ (this) .removeClass ("over");});});  

It is being applied to blocks of this kind:

   & Lt; / Li & gt; & Lt; Li & gt; & Lt; Label for = "business" class = "desc" & gt; Your charter flight objective: & lt; / Label & gt; & Lt; Div & gt; & Lt; Period & gt; & Lt; Input type = "radio" name = "purpose" id = "business" square = "radio" /> & Lt; Label class = "business" for "options" & gt; Business & lt; / Labels & gt; & Lt; / Span & gt; & Lt; Period & gt; & Lt; Input type = "radio" name = "purpose" id = "fun" class = "radio" /> & Lt; Label class = "likes" for "likes" & gt; Enjoy & lt; / Labels & gt; & Lt; / Span & gt; & Lt; / Div & gt; & Lt; / Li & gt;  

I tried to hang around with toggles, but I am looking for another beautiful solution, in which complex logic has not been used to work. Any ideas?

I too came into this problem long time ago, and oddly it was a radio button

Instead of trying to use, here I have an example of that problem

  $ ("input # zendesk-dropbox-ask" Before, input #zendesk-dropbox-newhere ") .change (function () {$ (" label #zendesk-dropbox-label-askbefore, label #zendesk-dropbox-label-newhere "). ToggleClass ('zendesk-dropbox- Label-highlight ');});  

If this ID is not clear from its crazy use of names, then input #zendesk-dropbox-askbefore & amp; There are both radio buttons in the Input # zendesk-dropbox-newhere .


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -