how do you get a reference to an outer div using jquery

Posted by oo on Stack Overflow See other posts from Stack Overflow or by oo
Published on 2010-05-13T10:07:34Z Indexed on 2010/05/13 10:14 UTC
Read the original article Hit count: 163

Filed under:
|

if i have this html

<div class="whole">This is a <div class="min">Test</div></div>

i want to change the html of the "whole" div when i click on the "min" div:

i have tried this below, but it doesn't seem to work.

$(document).ready(function() {
    $('div.min').live('click', function() {
         $(this).prev('.whole').html("<img  BORDER=0 src='../../images/copy1.png' />");
    });
});

does anyone have any ideas on whats going wrong here ?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-selectors