みんな、accesskeyってどうしてる? tabindexは?

このエントリーをはてなブックマークに追加
290H&A
>>289
こんなカンジでしょうか。
リンクテキストはrel属性値+rev属性値を、accesskeyはrel/rev属性のどちらかに
リンク形式が単独で存在する場合のみ指定されます。
IE6とMozilla {Build ID:2001112303}とOpera 6.01では動作しているっぽいのですが、
ちゃんと確認していません。スクリプトに詳しい人、フォロープリーズ!

var keys = new Array();
keys["Start"] = "S";
keys["Next"] = "N";
keys["Prev"] = "P";
keys["Contents"] = "C";
keys["Index"] = "I";
keys["Glossary"] = "G";
// …てなカンジでリンク形式 - accesskeyの配列を用意します

function OutputNaviLinks()
{
  // リンク一覧の取得
  var links;
  if (document.getElementsByTagName)
    links = document.getElementsByTagName("link");
  else if (document.all)
    links = docuemnt.all.tags("link");
  if (!links) return;
  // 出力
  document.writeln('<ul class="navigation" title="ナビゲーション">');
  for (var i = 0; i < links.length; i++) {
    if (links[i].rel.indexOf("stylesheet") >= 0) continue;
    document.write('<li><a');
    if (links[i].rel) document.write(' rel="' + links[i].rel + '" ');
    if (links[i].rev) document.write(' rev="' + links[i].rev + '" ');
    if (links[i].href) document.write(' href="' + links[i].href + '" ');
    var key = keys[links[i].rel] || keys[links[i].rev];
    if (key) document.write(' accesskey="' + key + '"');
    document.writeln('>' + links[i].rel + links[i].rev + '<\/a><\/li>');
  }
  document.writeln('<\/ul>');
}