views:

536

answers:

2

Hello,

I need a little help here if possible, because I can,t find the source attr of an image with the selector

I have already used $(this).children('someclass')just before and the one I am trying to locate is in the same tablecell next too the other div

So, it makes no sense to me

$(".reg_info_body").hide();
$(".reg_info").toggle(function(){
    $(this).children(".reg_info_body").slideDown(100);

    var $bb = $(this).parent().next(".img_uitklapbaar").attr("src");
    alert("source img: " + $bb); // for testing


    }, function(){
     $(this).children(".reg_info_body").slideUp(300);
    }
);




//HTML part

<tr class="reg_rij">
          <td width="20%"><div class="reg_form_label">Voornaam:</div></td>
          <td width="12%" class="reg_info" > <input type="text" class="reg_invoer" name="voornaam" 
          size="20" maxlength="20" value="<?php if (isset($trimmed['voornaam'])) echo $trimmed['voornaam']; ?>" /></td>
          <td width="4%" class="reg_info">?*</td>
          <td width="64%" class="reg_info"><div class="reg_info_body"><h4>? -: Voornaam [verplicht]</h4><p>
          Vul hier uw voornaam in</p></div>
            <div align="right"><img  class="img_uitklapbaar" src="../images/expand_icon.gif" width="16" height="16" /></div></td>
        </tr>

thanks, Richard

A: 

maybe, I have too change it a little bit, but it is not completely accurate

var $bb = $(this).parent().find(".img_uitklapbaar").attr("src");

I will keep with my previous finding for the moment see example

A: 

You can also check out the siblings method. Might work for you as well.

Chris Brandsma
I think,I try'd everything now, possibly not in the right wayThat's why I got into trouble, but at least I found it using one method. So, it's good for now, thanks