Untitled
unknown
plain_text
5 months ago
1.7 kB
2
Indexable
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>My E-Commerce Website</title> <link rel="stylesheet" href="style.css"> </head> <body> <header> <h1>My E-Commerce Website</h1> <div id="cart"> <button onclick="viewCart()">View Cart (<span id="cart-count">0</span>)</button> </div> </header> <main> <div class="product"> <img src="images/product1.jpg" alt="Product 1"> <h2>Product 1</h2> <p>$10.00</p> <button onclick="addToCart('Product 1', 10)">Add to Cart</button> </div> <div class="product"> <img src="images/product2.jpg" alt="Product 2"> <h2>Product 2</h2> <p>$20.00</p> <button onclick="addToCart('Product 2', 20)">Add to Cart</button> </div> <div class="product"> <img src="images/product3.jpg" alt="Product 3"> <h2>Product 3</h2> <p>$30.00</p> <button onclick="addToCart('Product 3', 30)">Add to Cart</button> </div> </main> <!-- Modal for cart --> <div id="cart-modal" class="modal"> <div class="modal-content"> <h2>Your Cart</h2> <ul id="cart-items"> <!-- Cart items will be listed here --> </ul> <div id="cart-total">Total: $0.00</div> <button onclick="checkout()">Checkout</button> <button onclick="closeCart()">Close</button> </div> </div> <script src="script.js"></script> </body> </html>
Editor is loading...
Leave a Comment