Which is a more semantically correct markup element for a “terms of use” agreement?
textarea
form element,
div
with scrollbars, or
iframe
?
They all look the same because CSS allows us to style all elements. Once again, the choice should not be how an element looks, only what it means.
Don’t scroll down until you have thought about the answers and made your decision.
The following is fact mixed with a healthy amount of author opinion. Take it how you like: spoonful of sugar or straight-up.
textarea
element triggers forms mode in screen readers and can severely confuse users. It also limits the contents to plain text where the other options could have multiple pragraphs, headings, links, etc.div
solution would be my choice. It’s plain document text, so it will work in every browser, and you get the scroll effect in browser versions 5.0 and up. This solution can also handle child elements like multiple paragraphs, headings, and links.iframe
choice is partially acceptable as well. It is a valid use and can also handle child elements. The reasons I’d recommend against it are that it doesn’t work in older browsers and frames have been deprecated from the XHTML specification. We won't get into the reasons against frames, but they are numerous.Just for your information, here are the elements in their default (unstyled) forms. Actually the iframe
still has style (font-size
and background-color
) defined in it’s source file.
textarea
form element,
div
with scrollbars, or
iframe
?