What values can the HTML5 aria-label attribute have?
Can开发者_StackOverflow中文版 someone give me some examples of what type of values are valid for the aria-label attribute.
It can be any string, which is used to name an element. The ARIA spec: aria-label
says:
Most host languages provide an attribute that could be used to name the element (e.g. the title attribute in HTML), yet this may present a browser tooltip. In the cases where a visible label or visible tooltip is undesirable, authors MAY set the accessible name of the element using aria-label.
So it's like the HTML title
attribute.
Like Alohci said, it can be a string. Any value you want. You use it like so:
<input aria-label="This can be anything inside quotes. It can be very long or very short. Can have numbers 1234567890 or symbols !@#$%^&*()-.,<>;/'[]{}\|-_=+å∫ç∂´ƒ©˙ˆ∆˚¬µ˜øπœ®ß†¨√∑≈ÅıÇÎ´Ï˝ÓˆÔÒ˜Ø∏Œ‰Íˇ¨◊„˛Á¸">
精彩评论