I am working on a site with jQuery Mobile "multipage" documents, where there may be several "pages" of the site that are coded as divs of a single html document. Here's the basic structure:
<body>
<div data-role="page" id="page1">
<header>Page 1</header>
<main>Content...</main>
<footer>...</footer>
</div>
<div data-role="page" id="page2">
<header>Page 2</header>
<main>Content...</main>
<footer>...</footer>
</div>
</body>
I would like to use the html5 <main>
element as shown, but the w3c validator gives me an error, saying "A document must not include more than one main element."
I understand that the w3c standards permit only one <main>
per document. However, the aria standards for role="main"
(to which <main>
is mapped) do allow "multiple main elements as DOM descendants, assuming each of those is associated with different document nodes" (https://www.w3.org/TR/wai-aria/roles#main).
Do these jQuery Mobile [data-role='page']
divs count as "different document nodes"? Can I have multiple <main>
elements if only one at a time is exposed to the end user?
(Note that inactive jQuery Mobile pages are in the document <body>
, but hidden with display:"none"
.)