Ashura: Frage zu onMouseOver

Beitrag lesen

Hallo Dani87.

<td width="14" height="17"  onmouseover="this.style.backgroundImage='url(/grafiken/vote.gif)';"
       onmouseout="document.getElemtById("test").style.backgroundImage='url()';
          this.style.backgroundImage='url(/grafiken/vote.gif)';"
       id="test"
       name="test"><a href=""><img src="/grafiken/spacer.gif" width="14" height="17" border="0"></a></td>

<td width="14" height="17"  onmouseover="this.style.backgroundImage='url(/grafiken/vote.gif)';"
       onmouseout="document.getElemtById("test").style.backgroundImage='url()';
          this.style.backgroundImage='url(/grafiken/vote.gif)';"
       id="test"
       name="test"><a href=""><img src="/grafiken/spacer.gif" width="14" height="17" border="0"></a></td>

  
Wie oft gibt es dich auf dieser Welt? Genau, nur ein einziges Mal. Für IDs gilt dasselbe, auch sie gibt es jeweils nur ein einziges Mal. Du kannst also nicht die ID „test“ zweimal vergeben.  
  
Des weiteren gibt es beim document-Objekt normalerweise keine „getElemtById“-Methode. Meintest du <http://de.selfhtml.org/javascript/objekte/document.htm#get_element_by_id@title=getElementById>?  
  
Und wozu brauchst du noch „spacer.gif“? Schon seit dem letzten Jahrtausend gibt es die <http://de.selfhtml.org/css/eigenschaften/innenabstand.htm@title=padding>-Eigenschaft in CSS.  
  
  
Einen schönen Mittwoch noch.  
  
Gruß, Ashura  

-- 
sh:( fo:} ch:? rl:( br: n4:~ ie:{ mo:| va:) de:> zu:} fl:( ss:) ls:[ js:|  
„It is required that HTML be a common language between all platforms. This implies no device-specific markup, or anything which requires control over fonts or colors, for example. This is in keeping with the SGML ideal.“  
[[HTML Design Constraints: Logical Markup](http://www.w3.org/History/19921103-hypertext/hypertext/WWW/MarkUp/HTMLConstraints.html)]