Delete Input groups

How can I delete input groups from the page with jquery?

I have the following form that I want users to be able to click an "x" next to the group and delete the input group.
<form class="col-md-12 add-priv-co" action="submit.php" method="post" style="margin-top:20px;margin-bottom:20px;">

                        <label>Competitor Links</label>

                              <div class="form-group rssRow">
                                <div class="col-md-6 noPadLeft">
                                    <input class="form-control" name="title[]" placeholder="Competitor Name" required/>
                                </div>
                                <div class="col-md-6 noPadLeft">
                                    <input class="form-control facebookURL" name="link[]" placeholder="Link" required/>
                                </div>
                                <div class="clearfix"></div>
                            </div>

                 
                        <input type="hidden" name="submitType" value="25"/>
                        <input type="hidden" name="userID" value="<?php echo $userID;?>"/>
                        <input type="hidden" name="orgID" value="<?php echo $orgID;?>"/>

                        <input type="button" class="btn loginBTN pull-right" id="add-row" name="add-row" value="ADD ROW" />
                        <button class="btn loginBTN">SAVE</button>
                        <script>
                            $('.add-priv-co').submit(function () {
                                var setFBurl = "www.facebook.com/";

                                // Get the Login Name value
                                var name = $('.facebookURL').val();

                                // trim it
                                name = $.trim(name);

                                //make it all lowercase
                                name = name.toLowerCase();

                                if (name.indexOf(setFBurl) < 0){
                                    setTimeout(function() { alert('Please enter a correctly formatted Facebook URL.'); }, 100);
                                    return false;
                                }

                            });
                        </script>
                    </form>

Open in new window

LVL 12
Nathan RileyFounderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hieloCommented:
You could use a span like the one below (you will need to style it with CSS of course) or you could even use an <img/> tag.  But the what's of interest to you is the onclick handler shown below.
<form>
<div class="form-group rssRow">
<span onclick="this.parentNode.parentNode.removeChild(this.parentNode)">X</span>
...
</div>
...
</form>

Open in new window

1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Nathan RileyFounderAuthor Commented:
Perfect, thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.