.nils.: wie bekomm ich die id des elments?

Beitrag lesen

Hallo,

<a id="something" href="javascript:loadContent('something', this.id);">blabla</a>

habs nicht getestet, aber probiere es mit this statt this.id

Dann frage einfach in deiner Funktion den Wert des id-Attributes ab

Also so:

  
loadContent(x,y) {  
   meineVariable = y.[link:http://de.selfhtml.org/javascript/objekte/node.htm#get_attribute_node@title=getAttributeNode]("id");  
}  

Aufruf:

  
<a id="something" href="javascript:loadContent('something', this);">blabla</a>  

Gruß, Nils