●
4 people have this in their cart
.png)
<div class="red-div">
<span class="blink">●</span>
<span id="cartCount" style="color: #9F7301;">4</span> people have this in their cart
</div>
<script>
// Function to update the random number every 15 seconds
function updateRandomNumber() {
// Generate a random number between 4 and 20
var randomCount = Math.floor(Math.random() * (20 - 4 + 1)) + 4;
// Display the random number in the HTML
document.getElementById("cartCount").innerText = randomCount;
}
// Call the function immediately to set the initial random number
updateRandomNumber();
// Update the random number every 15 seconds
setInterval(updateRandomNumber, 15000);
</script>
<style>
.red-div {
background-color: #FFF8D0;
padding: 2px 10px; /* 6px vertical, 10px horizontal */
border-radius: 8px; /* Rounded corners */
display: inline-block; /* Display as inline-block */
text-align: center; /* Center align the content */
margin: 0 auto; /* Horizontally center the red-div */
color: #9F7301; /* Text color */
font-weight: 500; /* Medium font weight */
font-size: 12px; /* Set font size */
}
.blink {
color: inherit; /* Inherit color from parent */
display: inline-block; /* Display as inline-block */
vertical-align: middle; /* Align vertically to middle */
font-size: 12px; /* Set font size */
margin-right: 5px; /* Add some space between the dot and the text */
}
</style>