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

  • Home
  • SEARCH
  • 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 8890921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:36:40+00:00 2026-06-14T22:36:40+00:00

I am working on jQuery here I have a html page. In the html

  • 0

I am working on jQuery here I have a html page. In the html I have two div’s; the first div contains image, name, and price right now we have to move image to another div which is empty div

Here I had done to (move) add image form first to second. Now I want to delete the image from the second div using jQuery which is added image

Here is my markup and code:

<div>              
    <span class="span1">
    <img src="~/Images/galaxy.jpeg" /></span> 
    <span class="span1">1232</span>
    <span class="span2">Cell Phone</span> 
    <span class="span1">3500</span>              
    <a href="#" class="pull-right" ><i class="icon-plus" onclick="AddToCart(this)" id="btnid" ></i></a>
</div>

<div class="span7" style="border:1px black" id="separat">
</div>

and this is my jQuery code:

function AddToCart() {
        var img = $(this).closest('div').find('img').first();
        var price = $(this).closest('span2').clone();
        alert(price);
        var image_id = $(img).attr('id');
        var newobj = $('<div>');
       newobj.prepend(img.clone());
       newobj.append('<span>' + image_id + '<a href="#"><i class="icon-remove" <span></i></a>');
         alert(image_id);        
        $('#separat').append(newobj);
}

$(function () {
        $('.icon-plus').click(AddToCart);
});

This is my remove function

function RemoveCart() {
    //var img = $this.find('img').RemoveCart();
    $(".separat").clone().find("img").remove();
}

$(function () {
    $('.icon-remove').click(RemoveCart);
});

Here I am adding image to the second div I need to get delete the image from second div I have a icon-plus image button which from (Separat) div
When I click on it it should remove from the div

Please help me to do this thanks in advance

  • 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-14T22:36:40+00:00Added an answer on June 14, 2026 at 10:36 pm

    You can just use

    img.remove();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi all iam working on jquery here i have a html page. in the
I am working with jQuery. Here I have an html page. In the html
I'm working with a dynamic DOM here, and have called the jQuery UI datepicker
Still working through JQuery to get data and repopulate portions of a page. Right
I have a trouble with selecting element attributes with jquery here is my HTML:
I have two pages: index.html and main.html When i set the main.html page to
I am having a WTF moment here. I have been working with jQuery since
I have a HTML page which is divided into two frames. Separate web sites
In an HTML page, I have three blocks: two textboxes and one inline SVG,
I have a FireWorks-generated HTML page and I added some jQuery to it for

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.