Search code examples
jqueryhtmlimagehref

How to get img src inside a href jquery


Hi i have an image inside a href. Is there any way to get the img src as text using jQuery?

<a id="img_id"><img src='add-icon.png' height="15" width="15"></a>

Solution

  • var img_src = $("#img_id").find("img").attr("src");