jquery remove by parent div
<p>Please consider following snippet:</p>

<pre><code>&lt;div class="row"&gt;
    &lt;div class="span12"&gt;
        &lt;div class="control-group"&gt;
            &lt;label class="control-label"&gt;Person Name&lt;/label&gt;
            &lt;div class="controls"&gt;
                &lt;input type="text" class="input-medium"&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>The classes belong to grid-based css framework named 'bootstrap' and are used for positioning and styling.</p>

<p>The 'row' is inside of the single form. The form provides input for many persons. Each 'row' corresponds to a single person with its input details. (in this example I have only one property for simplicity - 'Person Name') So I can have many snippets/'rows' like this in a single form.</p>

<p>What I would like to do is to create a button which would be inside every 'row' and whenever it is clicked it would delete the entire row in which it resides, but would not affect  other rows which belong to other persons' input details.</p>

<p>So far as I understood the easiest option would be usage of jQuery'.remove' method. However it would require id enumeration of every 'row' in this case, which I can generate on server-side, but not in this case, lets just assume that it is not allowed - I don't have 'id' attributes and I can't add them, so I can't point function at the row id to delete. If I fetch class to '.remove' method the button will obviously delete all the rows.</p>

<p>Just to illustrate the situation. Multiple rows, notice the buttons.</p>

<pre><code>&lt;form&gt;
    &lt;div class="row"&gt;
        &lt;div class="span12"&gt;
            &lt;div class="control-group"&gt;
                &lt;label class="control-label"&gt;Person Name&lt;/label&gt;
                &lt;div class="controls"&gt;
                    &lt;input type="text" class="input-medium"&gt;
                &lt;/div&gt;
                &lt;div class="control-group"&gt;
                    &lt;div class="controls"&gt;
                        &lt;button type="button" onclick="deleteTheEntireRow()" class="btn btn primary"&gt;Delete Person&lt;/button&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="row"&gt;
            &lt;div class="span12"&gt;
                &lt;div class="control-group"&gt;
                    &lt;label class="control-label"&gt;Person Name&lt;/label&gt;
                    &lt;div class="controls"&gt;
                        &lt;input type="text" class="input-medium"&gt;
                    &lt;/div&gt;
                    &lt;div class="control-group"&gt;
                        &lt;div class="controls"&gt;
                            &lt;button type="button" onclick="deleteTheEntireRow()" class="btn btn primary"&gt;Delete Person&lt;/button&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
            &lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p>I apologise for formatting.</p>

<p>Essentially what a button must do:
 detect and select just its fourth parent 'row', so I could apply `.remove' method. </p>
