Knight: Zugriff auf Element durch Attribut eines Kindelements

Beitrag lesen

Hallo,

Ich habe eine kleines Problem. Und zwar will ich im Code
[code lang=html]
<div id="myDiv">
  <div id="a3b2h43j75k" class="myClass">
    <img src="bild1" alt="bild1" />
  </div>
  <div id="jd83jd83hd9s" class="myClass">
    <img src="bild2" alt="bild2" />
  </div>
  <div id="jlksjf03kl9" class="myClass">
    <img src="bild3" alt="bild3" />
  </div>
  <div id="ah4h6wu27uj" class="myClass">
    <img src="bild4" alt="bild4" />
  </div>
  <div id="öakjsjf57mns" class="myClass">
    <img src="bild5" alt="bild5" />
  </div>
</div>
[code]

durch JavaScript ein bestimmtes Bild durch sein Attribute (src oder alt) ansprechen und das Mutterelement (also die darüberliegenden Div's) dieses Bildes auf style="display: none;" setzten. Wie schaffe ich das? Ich hab schon einige document.getElementsByAttribute() Emulator ausprobiert, funktioniert aber nicht.
WICHTIG: Die ID der Div's ist variabel und nicht fest!