<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
 <title>JavaScript: Ausgabe Titel des Link-Tags in der Statuszeile</title>

 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <meta http-equiv="Content-Style-Type" content="text/css">

 <meta name="description"
  content="&Uuml;bung JavaScript. Ausgabe Titel des Link-Tags in der Statuszeile">
 <meta name="keywords" content="HTML, JavaScript">
 <meta name="author" content="Roland Unger">

 <script language="JavaScript" type="text/javascript">
 <!--

 function addEvent(obj, eventType, afunction, isCapture) {
  // W3C DOM
  if (obj.addEventListener) {
   obj.addEventListener(eventType, afunction, isCapture);
   return true;
  }
  // Internet Explorer
  else if (obj.attachEvent) {
   return obj.attachEvent("on"+eventType, afunction);
  }
  else return false;
 }

 function removeEvent(obj, eventType, afunction, isCapture) {
  if (obj.removeEventListener) {
   obj.removeEventListener(eventType, afunction, isCapture);
   return true;
  }
  else if (obj.detachEvent) {
   return obj.detachEvent("on"+eventType, afunction);
  }
  else return false;
 }

 function processAnchorEvent(event) {
  if ((event.type=="mouseover") || (event.type=="focus")) {
   // Internet Explorer
   if (event.srcElement) window.status=event.srcElement.getAttribute("title");
   // W3C DOM
   if (event.currentTarget) {
    window.status=event.currentTarget.getAttribute("title");
    event.stopPropagation();
    if (event.cancelable) event.preventDefault();
   }
  }
  if ((event.type=="mouseout") || (event.type=="blur")) {
   if (event.srcElement) window.status="";
   if (event.currentTarget) {
    window.status="";
    event.stopPropagation();
    if (event.cancelable) event.preventDefault();
    // in case of mouseout anything should be done for focused links.
   }
  }
  return true; // for IE, identical to event.preventDefault()
 }

 function initAnchorStatus() {
  var anchorList, aTitle, i;

  if (document.getElementsByTagName) {
   anchorList=document.getElementsByTagName("a");
   if (anchorList.length>0)
    for (i=0; i<anchorList.length; i++) {
     aTitle=anchorList[i].getAttribute("title");
     if ((aTitle!=null) && (aTitle!="")) {
      addEvent(anchorList[i], "mouseover", processAnchorEvent, false);
      addEvent(anchorList[i], "focus", processAnchorEvent, false);
      addEvent(anchorList[i], "mouseout", processAnchorEvent, false);
      addEvent(anchorList[i], "blur", processAnchorEvent, false);
     }
    }
  }
 }

 onload = initAnchorStatus;

 // -->
 </script>

</head>

<body>

<h2>&Uuml;bung JavaScript</h2>
<h3>Ausgabe Titel des Link-Tags in der Statuszeile</h3>

<p>Wenn Sie mit der Maus &uuml;ber die Hyperlinks fahren oder diese mit der
Tabulator-Taste fokusieren, so wird die im Titel des Hyperlinks angegebene
Erl&auml;uterung in der Statuszeile ausgegeben:
<a href="main_index_list.html" target="_top"
 title="Zur&uuml;ck zur &Uuml;bersicht der Skripten">Skripten</a>,
<a href="index.html" target="_top"
 title="Zur&uuml;ck zur Einf&uuml;hrung">Einf&uuml;hrung</a>.
</p>

</body>
</html>