<script type="text/javascript">
function checkFocus(aExpected, aTabIndex)
{
elemCurr = document.activeElement.getAttribute("id");
is(elemCurr, aExpected, "Element with tabIndex " + aTabIndex
+ " did not receive focus!");
}
function doTest()
{
// First, test img with tabindex = 0
document.getElementById("img-tabindex-0").focus();
checkFocus("img-tabindex-0", 0);
// now test the img with tabindex = -1
document.getElementById("img-tabindex-minus-1").focus();
checkFocus("img-tabindex-minus-1", -1);
// now test the img without tabindex, should NOT receive focus!
document.getElementById("img-no-tabindex").focus();
checkFocus("img-tabindex-minus-1", null);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.