Forum Moderators: open
The only way to negate an element from the tabindex according to the W3C is to disable it. I wanted to add the disable attribute dynamically with JavaScript (and not have to do so at the server because of validation issues). Correct - this is not valid code however it's also not valid behavior. I was not able to find the specific XHTML article though most HTML 4 is the same (with some deprecations to the contrast) as XHTML...
[w3.org...]
I have even manually attempted to add the disabled attribute to the body directly and Firefox still tabs to it! Suggestions?
- John
*Edit* Ops, helps to post the code! ;)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Tabindex Test</title>
<style type="text/css">body:disabled {}
</style>
<script type="text/javascript">
document.getElementsByTagName("body").setAttribute("disabled", disabled);
</script>
</head><body disabled="disabled">
<div>
<a href="#" tabindex="1">anchor 1</a>
<a href="#" tabindex="2">anchor 2</a>
<a href="#" tabindex="3">anchor 3</a></div>
</body>
</html>
[edited by: JAB_Creations at 7:20 am (utc) on June 5, 2007]
bug 383349 [bugzilla.mozilla.org].
- John
[edited by: jatar_k at 9:54 pm (utc) on June 5, 2007]
[edit reason] fixed link [/edit]