How to get image link (jQuery)

If you want to get image link using jQuery, use the following code:

$('#my_image').attr('src');

For example, if you have this HTML code:

<img id="my_image" src="image.jpg" alt="my image" />

As a result you will get  “image.jpg" path. 

Comments

No comments yet, you can leave yours: