Forum Moderators: open
I've been reading the thread on accesibility (and related links). I am using the accesibility valet (quite nice) to 'force' a set of pages to become AAA compliant (more a learning challenge than real need).
I designed as tables a set of pictures with captions. Afterwards, I added summaries as needed, but then I realized I should change that into nested DIVs (I've done it partialy).
But, the trouble is: How can I change the accesibility 'added value' of summary="this is blah, blah..." into div-like summaries? It seems that summary attribute is not admited inside div tags (at least in xhtml 1.1, that's what I'm typing for).
Thanks a lot :)
While not a particularly 'clean' way of doing things, you could always script the summaries as arbitrary attributes of the div elements, and you will still validate for xhtml scrict that way.
E.g.,
Script:function getObj(id) {
return document.getElementById(id);
}function writeSummary(obj, sum) {
obj.setAttribute("summary", sum);
}
Or (for browsers that don't support setAttribute):function writeSummary(obj, sum) {
obj.summary = sum;
}
HTML:...
<div id="div1" class="some-class">
</div><div id="div2" class="some-class">
</div><div id="div3" class="some-class">
</div>...
<script type="text/javascript">
<!--
writeSummary(getObj("div1"), "this is div1");
writeSummary(getObj("div2"), "this is div2");
writeSummary(getObj("div3"), "this is div3");
//-->
</script>
</body>
It's pretty kludgy, and I'm not sure if it would accomplish what you are trying to accomplish (I haven't had a chance to look at the accessibility section yet), but mabye it will be useful.
Shelumi`El
Jordan
S.D.G
Is summary not meant to provide the description for a set of tabular data (eg. 2003 Accounts) anyway? If so, would it not be slightly semantically redundant when applied to a table being used for layout?