text
text
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Clothing Store</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
background-color: #f4f4f4;
}
.header {
text-align: center;
color: #333;
}
.clothing-list {
display: flex;
gap: 20px;
justify-content: center;
flex-wrap: wrap;
}
.item {
background-color: white;
padding: 15px;
border: 1px solid #ddd;
border-radius: 5px;
width: 200px;
text-align: center;
}
.item button {
background-color: #28a745;
color: white;
border: none;
padding: 10px;
cursor: pointer;
}
.item button:hover {
background-color: #218838;
}
#cart {
margin-top: 20px;
padding: 10px;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 5px;
}
</style>
</head>
<body>
<div class="header">
<h1>Welcome to Our Clothing Store</h1>
</div>
<div class="clothing-list">
<div class="item">
<h3>T-Shirt</h3>
<p>$19.99</p>
<button onclick="addToCart('T-Shirt', 19.99)">Add to Cart</button>
</div>
<div class="item">
<h3>Jeans</h3>
<p>$39.99</p>
<button onclick="addToCart('Jeans', 39.99)">Add to Cart</button>
</div>
<div class="item">
<h3>Jacket</h3>
<p>$59.99</p>
<button onclick="addToCart('Jacket', 59.99)">Add to Cart</button>
</div>
</div>
<div id="cart">
<h2>Shopping Cart</h2>
<ul id="cart-items"></ul>
<p>Total: $<span id="cart-total">0.00</span></p>
</div>
<script>
let cart = [];
let total = 0;