Q:

JQuery - Adding content, indepent from wordpress theme

i want to write a simple function with the help of JQuery. I created this jfiddle:
<table class="my_table">
    <tr>
        <td class="correct"></td>
        <td>
            <input type="button" class="my_button" />
        </td>
    </tr>
    <tr>
        <td class="incorrect"></td>
        <td>
            <input type="button" class="my_button" />
        </td>
    </tr>
...

http://jsfiddle.net/Xz3xc/1/
After the click, some content is added to the  above of the button. This is the case on my local machine. I run another theme on my wordpress and the code there looks like this:
<table class="my_table">
    <tr>
        <td class="correct"></td>
        <td>
            <div>
            <input type="button" class="my_button" />
            </div>
        </td>
    </tr>
        <tr>
        <td class="correct"></td>
        <td>
            <div>
            <input type="button" class="my_button" />
            </div>
        </td>
    </tr>
...

http://jsfiddle.net/KuACZ/1/
There, of course the code is not working because one parent() is missing in the function. How can i write this function generic that it always takes the first td in the same tr where the button has been clicked, so that it is independent from the theme.
Thanks!

A:

This piece of code finds all the td's with class correct within the same tr.
$('.my_button').click(function() {
   $(this).parentsUntil("tr").siblings("td.correct").html('Test'); 
});

jsFiddle

