I am using an e-commerce platform that renders the shopping cart as below inside a single div, and I would like to remove everything after the number of items in the cart, starting with the "," through to the end of "Cart".
The number of items and the Total could be any value, so I would need something that wouldn't rely upon a set variable. This would also have to work dynamically as items could be added to the cart after the page loads and would need to update accordingly.
As I am rather new to Javascript and JQuery, I would very much appreciate any help that includes the full script.
1 item(s), Total: $25.19 View Cart
var con = $("#cartelementid"); con.text(con.text().split(',')[0]);