Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery - cannot select the parent div
    text
    copied!<p>I hope this isn't a waste of time, however I have really been trying to figure this on out. Is it my syntax. I simply want to remove the parent div ".number-row" once the link with a class of ".remove-link" is clicked.</p> <p>Thanks in advance</p> <pre><code>&lt;script&gt; $(document).ready(function(){ $(".remove-link").click(function() { $(this).parent(".number-row").hide(); }) }) &lt;/script&gt; </code></pre> <hr> <pre><code>&lt;div class="number-row" &gt; &lt;div class="number-column"&gt; &lt;div class="label-row"&gt; Select Country: &lt;/div&gt; &lt;div class="input-row"&gt; &lt;select&gt; &lt;option&gt;1&lt;/option&gt; &lt;option&gt;2&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="label-row"&gt; Select Toll Free or City: &lt;/div&gt; &lt;div class="input-row"&gt; &lt;select&gt; &lt;option&gt;1&lt;/option&gt; &lt;option&gt;2&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="label-row"&gt; Select Your Number: &lt;/div&gt; &lt;div class="input-row"&gt; &lt;select&gt; &lt;option&gt;1&lt;/option&gt; &lt;option&gt;2&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="number-column"&gt; &lt;div class="label-row"&gt; Select Country: &lt;/div&gt; &lt;div class="input-row"&gt; &lt;select&gt; &lt;option&gt;1&lt;/option&gt; &lt;option&gt;2&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="label-row"&gt; Enter Number to Forward to: &lt;/div&gt; &lt;div class="input-row"&gt; &lt;input type="text" name="forward_number" id="forward_number" /&gt; &lt;/div&gt; &lt;div class="number-row-options"&gt; &lt;a class="save-link" href="#"&gt;Save&lt;/a&gt; &lt;a class="remove-link" href="#"&gt;Remove&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload