Flags do not get focus when clicking on Chrome

I just came across another strange behavior in Chrome: when you click on a flag or its label, the flag does not receive focus (the body focuses instead).

This can be seen here: http://jsfiddle.net/YfbR7/7/ ( see code sample here )

Is there a workaround to make the checkbox get focus, for example, in other browsers?

+1
source share
1 answer

You can also solve this problem.

 $(function () { $("input[type=checkbox]").click(function (event) { $(this).parent().css("background", "red"); }); }) 
+1
source

Source: https://habr.com/ru/post/952348/


All Articles