Question: I need help with this assignment: just simple method, no fancy code's like this : ( if ( $ ( #cart ) . find

I need help with this assignment:
just simple method, no fancy code's like this :
(if ($("#cart").find(`.cart-item[data-name="${productName}"]`).length >0){ alert("Item already in the cart. Remove it first to add again."); return;
)
and explanations to all methods and functions,
please look at the screenshots: html and js begining how should be resolved,
thank you!
CGS 2820: JavaScript Programming Assignment 5: Shopping for Fruit
Part 1- File to download: Download the zip file, FruitMarket.zip, and extract it into your cgs2820 folder. Once you extract the contents of the zip file, you should see a folder named FruitMarket. RENAME the FruitMarket folder as FruitMarketYourInitials.
Part 2- Program description:
File: shoppingForFruitjQuery.html The document links to a JavaScript/jQuery file called shoppingForFruitjQuery.js described below. Study this HTML file and open it in your browser to see how it looks originally. DO NOT CHANGE THE CONTENTS OF THIS HTML FILE! File: shoppingForFruitjQuery.js (located in the js folder) Add jQuery statements to this file so that every time the user clicks on an image, a div element is created containing a copy of the image, the quantity selected by the user, the unit price, and the cost of the item. (Make sure that the user did enter a quantity. If not, display an error message and don't do anything else.) This new div should be put inside the div that has an ID of cart. When the user clicks the "Place your order" button, the total cost, tax (6%), and final cost of all items in the cart should be displayed with corresponding captions. When the user clicks on an image in the cart, it should be removed from the cart and the total cost should be adjusted accordingly.
Other requirements:
1. Do NOT remove the image from the product area when a user clicks on it. Make a new image using the information from the image that was clicked and add that new image to the cart. 2. You should not allow the same product to be placed in the cart if it is already in the cart. If an attempt is made to add the same item, display a message stating that the user should remove the item from the cart first. 3. When the user clicks on an image in the cart, remove that image ONLY from the cart. (Remember to adjust the total cost accordingly.)4. Clear the quantity input area after an image is selected from the product area. 5. Print all money with two decimal places. 6. Tax is collected on the total cost NOT on the cost for each item.
"use strict"; \$(function()\{
let cart=[];
\$("\#leftArea img").click(addToCart); function addToCart()\{
let newImage=\$("");
let src=\$(this).attr("src"); console.log(src);
newImage.attr("src",src); let newDiv=\$("
I need help with this assignment: just simple

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!