$('img').click(function() {
var fileName = $(this).attr('src');
alert(fileName);
});
MaurĂcio
-----Mensagem Original-----
De: <[email protected]>
Para: "jQuery (English)" <[email protected]>
Enviada em: segunda-feira, 12 de janeiro de 2009 10:59
Assunto: [jQuery] How to grab the filename (src attribute) of an image?
Hi all,
how do i grab the filename of an image?
Situation now:
i use "normal" javascript when clicking on an image and just inserted
some jquery to post gamedata to update a gamepage with the help of the
taconite plugin (returns xml-data), so far so good.
I just miss one item => i need the filename (src attribute of the
image) of the image on which was clicked, ut just can't figure out how
to grab it.
Thanks in advance for your help.