<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Product Page with Slider</title>
<style>
/* Add some styles for better appearance */
body {
font-family: Arial, sans-serif;
padding: 20px;
}
#priceLabel {
font-size: 18px;
margin-bottom: 10px;
}
#priceSlider {
width: 80%;
}
</style>
</head>
<body>
<h1>Product Page</h1>
<div>
<label for="priceSlider" id="priceLabel">Select Price:</label>
<input type="range" id="priceSlider" min="0" max="100" step="1" value="50" oninput="updatePrice()">
</div>
<script>
// Function to update the price label dynamically
function updatePrice() {
var priceSlider = document.getElementById('priceSlider');
var priceLabel = document.getElementById('priceLabel');
// Display the selected price
priceLabel.innerText = 'Select Price: $' + priceSlider.value;
}
</script>
</body>
</html>