I am creating a search form that has two elements: an input field and a button. The input field does not have a label associated with it.
To make the field more accessible, I can add <label for="searchfield">Search</label>and visually hide it so that it can, for example, be readable from the screen.
<label for="searchfield">Search</label>
I could also add aria-label="search"to the input field and leave the input field unmarked.
aria-label="search"
I tested with "Voice Over" on a Mac and get the same result / output. My question is, are these approaches equivalent? Or is one approach better than the other?
Here is the pen .
- ( ?) ( ?), :
ARIA CSS ( , chunked ..) , .
, <label>. . CSS , . ARIA, . , ARIA, ( - ). SRs.
<label>
, , , ( ) ( Unor). , , placeholder ( <label> CSS, ).
placeholder
SVG, ARIA, SVG.
FWIW, title, - , , , meh.
title
, :
, ?
, .
aria-label CSS, label.
aria-label
label
( : aria-label , )
, , . , " ", , .
( : )
, , . - title input. title , , ( , title input) 3.
input
, aria-label="search" , (.. label), CSS - .
, label CSS "" , ARIA , .
, , , , ARIA, , label . , , , .
Source: https://habr.com/ru/post/1673544/More articles:Python Flask SQLAlchemy Pagination - pythonFileProvider - open a file from the download directory - androidIs it legal for the C compiler to optimize local static variables? - cFailed to open trivial text file using FileProvider - androidGrouping is automatically grouped by all non-numeric columns in pandas? - pythonHTA and batch hybrid by passing variables from the BATCH section - cmdSeparate login page using HashRouter in action - reactjsMocked mongodb using mongoimport imports json array as element - dockerSerializable class not available to broker: java.lang.ClassNotFoundException when viewing messages in ActiveMQ - javaThe chain assigns a celery task to a distributed group - pythonAll Articles