how get only src value of image in java script

I have this value in image tag

I am using jqgrid and when I call

$('#testGridList').jqGrid ('getCell', id, 'pic');

This return

<img src="http://localhost:8080/myApp/DownloadFile?type=THU_IMG&amp;id=409" height="70" width="90" class="example1tooltip" style="cursor:pointer" alt="photo" title="View Org photo" onclick="getUxx()">

How do I get only src value?

Answers 1

  • Try using attr() as shown :-

    var gridcell = $('#testGridList').jqGrid ('getCell', id, 'pic');
    var imgsrc = $(gridcell).attr("src");
    

    DEMO


Related Articles