Well, it depends where you need it...
Read jQuery HowTo Resource - http://jquery-howto.blogspot.com
On Mon, Jan 12, 2009 at 10:19 PM, webmas...@terradon.nl
wrote:
>
> Where and how do i implement var fileName = $(this).attr('src');
>
Thanks for the answers, i see some daylight now, but
i already have a normal onclick event on the image, triggering my
normal js function:
squareClicked(row,col,isEmpty)
{
// my other normal js function
// with jquery : showing message div
// my jquery post to taconite plugin page, proces
I believe he/she is binding an event with javascript not jquery's event binding.
Webmaster you can refer to an element which was clicked with "this"
keyword. So to get your image source just use "this.src" property.
Example:
The same when applying with event listeners...
-
Read j
$('img').click(function() {
var fileName = $(this).attr('src');
alert(fileName);
});
MaurĂcio
-Mensagem Original-
De:
Para: "jQuery (English)"
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,
h
4 matches
Mail list logo