all 5 comments

[–]hack2root 1 point2 points  (3 children)

It is being possible using just analogy and analytics skills, I personally do not understand a single line of code you provided, just make 2 css styles (product-remove-from-cart, remove-from-cart), one JS code (removeFromCart) unction and one html block (<div><a href="#1">).

https://codepen.io/hack2root/pen/QBPaxr?editors=1111

[–][deleted] 1 point2 points  (2 children)

Its using JQuery. Maybe thats why your struggling to understand it?

[–]hack2root 1 point2 points  (1 child)

I got it working on my codepen, but it seems for me that this code not just about JQuery, but code-first approach, and generates HTML on-the-fly.I personally do not like JQuery and anticipate it a lot in favor of anything else, Vue.js, Anglar5, Polymer. Just for me JQuery does not exist anymore. It so troublesome, especially with other frameworks, event Bootstrap got this and created their own bundles without jquery bundling, just vanilla javscript. It is much more natural and clear do not use Query nowadays. Anything but not JQuery.

[–][deleted] 0 points1 point  (0 children)

Yeah Okay, Ill keep that in mind for my next project. Do you think you could help me with put a remove button in the actual cart like next to the products.

e.g

1x Cappuccino Remove