Does Google Chrome not trigger event blur on radio buttons?

This is my first post - hello everyone

I am currently developing an html form with support for css and jquery. The form will be used by "inexperienced users", so I focus on good use. Therefore, I give a hint to all input fields with further instructions. To show the hints, I use the onfocus / onblur javascript event, so only one hint is displayed. This worked well when I only had input fields of type="text" , but with input fields of type="radio" I had problems in google chrome.

I made a quick example of jsfiddle.net so you can see what I mean. The code is very similar to the code that I use in my form, so I did not post it here. A warning appears in every browser that I have tested so far except google chrome. I wonder why? Is there any known solution or workaround?

+7
source share
3 answers

Working sample :

 $('input').on({ click: function (e) { this.focus(); $('#' + this.id + 'msg').show(); }, blur: function (e) { $('#' + this.id + 'msg').hide(); } }); 
+3
source

From quirksmode :

Safari and Chrome do not trigger focus / blur events when the user uses the mouse to access flags, radios, or buttons. Text fields, text fields and checkboxes work correctly.

There are some tips for working with this here .

+4
source

blur will work with certain versions of Chrome (but not mine 10.0.648.205), but only if you move away from the entire set of elements. Not sure if this is useful, but this will work:

 $('input:radio').click(function() { alert('why does this not show up in google chrome?!'); }); 

NTN.

+2
source

All Articles