I want to give users help in which format they have to enter a date. The label content is:
Date (YYYY-MM-DD)
I used the following markup:
<label>Date (<kbd><abbr title="four-digit year">YYYY</abbr>-<abbr title="two-digit month">MM</abbr>-<abbr title="two-digit day">DD</abbr></kbd>)</label>
Note: the new HTML5 input-type values (like date) might be used, but this label is a fallback for users with older browsers. Most of them use screenreaders and I try to give the most nitty-gritty markup.
I wonder:
- Should I use the
codeelement? - Is my use of the
kbdelement correct in this context? The "YYYY-MM-DD" represents something that users should enter, but it isn't something they should enter exactly as given, of course. It's more some kind of variable, I guess. - So maybe the
varelement might be appropiate? - Is my use of the
abbrelement correct? - Should I use the
dfnelement around eachabbrelement? So "YYYY" would be defined as year, because strictly spoken it is not an abbreviation for "four-digit year" but for "Year Year Year Year".