Avatar of JRockFL
JRockFLFlag for United States of America

asked on 

Access img src

How can I access the src of the image?
I need be able to get a reference from the current event handler.
I wont know the id.

$('#photo-list li a').click(function () {
  var id = $(this).attr('id');
});


<ul id="photo-list" class="upload-photo-list" style="">

<li>
<a id="link1">
	<img src="" />
</a>
</li>
<ul>

Open in new window

jQuery

Avatar of undefined
Last Comment
JRockFL
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Gary
Gary
Flag of Ireland image

Reference to what/from what?
Avatar of JRockFL
JRockFL
Flag of United States of America image

ASKER

perfect!
jQuery
jQuery

jQuery (Core) is a cross-browser JavaScript library that provides abstractions for common client-side tasks such as Document Object Model (DOM) traversal, DOM manipulation, event handling, animation and Ajax. jQuery also provides a platform to create plugins that extend jQuery's capabilities beyond those already provided by the library.

19K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo