When the mouse cursor moves over an image, I would like to display an alert() containing the value of that image’s src attribute. How could I go about accomplishing this?
When the mouse cursor moves over an image, I would like to display an
Share
You can use the mouseover event.
If you have
You can have some jQuery code like
(if this fails you could also try replacing
$(this)with$('#bar'), but as noted in the comments it’s pretty ugly)edit: missed the need to display the src attribute first time through..