jquery how to get html of image in nested div? -


i have following html

  <a class="lid" id="1">       <div class="map_image">       <img width="220" height="145" alt="" src="photo.jpg" typeof="foaf:image">      </div>   </a> 

im using following jquery id of link.

  function onlid {    .setcontent($(this).attr("id"));   }    $('.lid').on('mouseover', onlid); 

so in case content set 1, id of class lid 1.

what whole html of , set after 1.

so content

   1 <img width="220" height="145" alt="" src="photo.jpg" typeof="foaf:image"> 

im trying like

      .setcontent($(this).attr("id") + $(this.map_image).html()); 

any appreciated.

thanks

from question it's not entirely clear you're trying html.

this code should find html inside of map_image class relative anchor tag , alert it:

function onlid (event) {    var $lid = $(event.target);    var imghtml = $lid.find('.map_image')[0].innerhtml;    var lidid = $lid.attr('id');    alert(lidid + imghtml); } 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -