setting tabs

D

David McDivitt

I need to set tabs on java generated pages. Pages have four sections:
header, sidebar, body, and footer. The sidebar and body change dynamically.
The tab key must go to anchors and buttons doing all in the header first,
all in the sidebar second, etc. A base page contains includes for all the
pieces and has the body tag.

I am trying to use code pasted below. It has two problems. One, I should not
have to check childnodes.length before doing recursion. If I remove that it
gets stuck in a loop. With it, it does not recurse into child nodes. Two, I
would like to know what attribute to check prior to setting the tabindex
property, probably URN non blank or TYPE non blank. Help would be
appreciated. Thanks

<script language="javascript">
<!--
tab = 0;
if(document.all && !document.getElementById) {
document.getElementById = function(id) {
return document.all[id];
}
}
function setTabs (childObject) {
for (j=0;j<childObject.childNodes.length;j++) {
try {
childObject.childNodes[j].tabIndex = tab;
tab++;
if
(childObject.childNodes[j].childnodes.length > 0)
setTabs(childObject.childNodes[j]);
}
catch (e) {
}
}
}
function onLoadEvent() {
setTabs(document.getElementById('divTopHeader'));
setTabs(document.getElementById('divTopMenu'));
setTabs(document.getElementById('divTopBody'));
setTabs(document.getElementById('divTopFooter'));
}
//-->
</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top