With JQuery I want to be able to get the img src link.
<tbody>
<tr>
<td headers="header_0 header_1"> <img
src="https://this-link-here.com" width="26"
height="24" alt="" border="0" /></td>
I have tried
var data = $(data).find("[headers='header_0 header_1']");
but this is not getting the link. Similarly I have tried adding .text()
, and .html()
but still no luck.
Can anyone help? The HTML cannot be changed.
You can use either the .attr() function:
Or the vanilla JS
.src
function, if there is only one with those headers:The vanilla JS way is faster, only reason I threw it in.
Do it like this:
Demo: http://jsfiddle.net/udeXR/2/
Use the .attr() function.
var data = $(data) etc.
. You can use a different selector if you wish..attr()