Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8971031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:51:19+00:00 2026-06-15T17:51:19+00:00

I am trying to remove a div when on AJAX success but am having

  • 0

I am trying to remove a div when on AJAX success but am having trouble doing so. On success, I see the words “Added” appear twice because I’m not able to select the 2 div’s that contain it properly. Any advice on how to select it properly?
javascript:

 success: function(message){                         
        alert("Deleting!");
        $this.closest('.image').find('.already_fav_content p').removeClass(); #doesn't work

        $this.closest('.image').find('.fav_content p').hide(); #doesn't work

        $this.closest('.image').find('.removebutton').hide(); #works

        $this.closest('.image').find('.already_favorited').removeClass(); #works

        $this.closest('.image').find('.fav').removeClass(); #works


div.fav{
    display: none;
    position:absolute; /* absolute position (so we can position it where we want)*/
    bottom:0px; /* position will be on bottom */
    left: 0px;
    /* styling bellow */
    background-color:#E99C07;
    font-family:  "Arial Black", Gadget, sans-serif;
    font-size:18px;
    font-weight:900;
    color:white;
    opacity:0.75; /* transparency */
    filter:alpha(opacity=70); /* IE transparency */
}
p.fav_content{
    padding:10px;
    margin:0px;
}

div.already_favorited{
    position:absolute; /* absolute position (so we can position it where we want)*/
    bottom:0px; /* position will be on bottom */
    left: 0px;
    /* styling bellow */
    background-color:#E99C07;
    font-family:  "Arial Black", Gadget, sans-serif;
    font-size:18px;
    font-weight:900;
    color:white;
    opacity:0.75; /* transparency */
    filter:alpha(opacity=70); /* IE transparency */
}
p.already_fav_content{
    padding:10px;
    margin:0px;
}                    

html:

<div class="wrapper">

                <!-- image -->
                <div class="image" style="position: relative; left: 0; top: 0;">

                    <a href="/partners/Business/forbes">
                        <img src="http://videomuncher.com/static3/forbes.png" style="position: relative; width: 150px; top: 0; left: 0;">
                    </a>


                    <!-- already fav div -->
                        <div class="already_favorited">
                            <!-- fav content -->
                            <p class="already_fav_content">Added</p>    <!-- end fav content -->
                        </div>
                    <!-- end already fav div -->

                    <!--  munchbutton div --> 
                    <div class="munchbutton" style="display: none;">
                        <form method="post" action="/munch_video/   " class="removebutton"><div style="display:none"><input type="hidden" name="csrfmiddlewaretoken" value="dKrS8NzqPWFLM6u8wJrAeid4nGw1avGK"></div>
                            <input type="hidden" value="Channel" class="playlist">
                            <input type="hidden" value="forbes" class="video_id">
                            <input type="hidden" value="forbes" class="video_title">
                            <input type="hidden" value="remove_video" class="remove">

                            <input type="submit" class="btn btn-danger" value="Remove">
                        </form>
                    </div>
                    <!-- end munchbutton div -->

                    <!-- fav div -->
                    <div class="fav">
                        <!-- fav content -->
                        <p class="fav_content">Added</p>    <!-- end fav content -->
                    </div>
                    <!-- end fav div -->

                </div>
                <!-- end image div -->

                </div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:51:20+00:00Added an answer on June 15, 2026 at 5:51 pm

    It didn’t wroked because selectors was wrong

        $this.closest('.image').find('.already_fav_content p').removeClass(); #doesn't work
    
        $this.closest('.image').find('.fav_content p').hide(); #doesn't work
    

    Change it to,

        $this.closest('.image').find('p.already_fav_content').removeClass();
    
        $this.closest('.image').find('p.fav_content').hide();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to remove this element on success function, but it's not doing it!!
I´m trying to remove a div with jquery but I don´t know how can
I'm trying to remove contents of particular div which are basically list items and
so my code works fine by itself, but I'm trying to add some ajax
I'm trying to use jQuery to add dynamic Add/Remove row function, but I meet
Best all, I'm trying to debug our CMS (what is mostly AJAX) but jQuery
hi am trying to create a new div but using the value from an
I'm trying to remove any duplicate or more occurrences of any < br >
I'm trying to remove part of the path in a string. I have the
I'm trying to remove scrollbar from my facebook app. I tried js solution, that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.