JQuery focus focus

On some of my pages, I focus on the first input element:

      $(':input:visible:first').trigger('focus');

If the first input element is a flag or a radio object, it receives a subtle focus, but it is not clearly visible, so the shortcut is not highlighted, and the screen reader does not recognize this either, that is, it does not read that field. Is there a way to use jQuery to make the emphasis on checkbox or radio boottags more pronounced?

+3
source share
1 answer

Can't you assign a suitable css class to it?

  $(':input:visible:first').focus(function() {
                               $(this).addClass("superClear")
                            })
                           .blur(function() {
                               $(this).removeClass("superClear");
                           }).focus();

In addition, this may be useful:

How to configure (css) radio buttons and shortcuts?

+2
source

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


All Articles