If I have the following html when I press the spacebar while the shortcut has focus, why is the radio not related to validation?
<input type="radio" name="first-radio" id="first-radio-id"> <label for="first-radio-id" tabindex="1">The first radio</label>
This makes accessibility difficult, is there a workaround other than javascript for this?
Here is a JSFiddle example: https://jsfiddle.net/atwright147/q0t53v78/
Label elements are not designed to receive keyboard focus.
So just delete the attribute tabindexand you can check the radio control with a space when this control is focused.
tabindex
, , CSS :
input:focus + label { outline: 1px dotted red; }
, ( , !) , , .
JavaScript, , , . , , , . .
Source: https://habr.com/ru/post/1629895/More articles:Disable content scrolling - iosStarting Docker and replacing variables - bashget screen scale in JavaFX using only open API - javaMeasuring the size of an object using a reference object in a photograph - image-processingGetting ExecutionException while getting file using asmack in Android - androidWhy does the second client from the same IP address have a 20 second timeout before displaying the page? - phpsaving images in chrome extension - javascriptAngularJS: What is the difference between $ log and console.log? - angularjsИспользовать несколько Json файлов в swagger-ui - swaggerhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1629900/mobile-and-desktop-responsive-markup&usg=ALkJrhgDiFmIsN4BFgQj48tfoe0tUnVPmwAll Articles