Stars are fascinating celestial objects that have captured human imagination for centuries. Here are some fun facts about them:
- Stars are giant balls of glowing gas, primarily hydrogen and helium.
- Our Sun is a star, and it provides us with heat and light.
- Stars vary in size, temperature, and brightness.
- The color of a star depends on its temperature, with cooler stars appearing red and hotter stars appearing blue.
- Stars go through various stages of life, including formation, main sequence, and eventually, they can explode as supernovas.
Explore the wonders of the night sky and learn more about the mysteries of the universe.
// Form submission handler
userInputForm.addEventListener("submit", function (e) {
e.preventDefault();
const userName = document.getElementById("userName").value;
alert(`Hello, ${userName}!`);
});
// Update date and time
function updateDateTime() {
const now = new Date();
dateAndTime.innerText = now.toLocaleString();
}
setInterval(updateDateTime, 1000); // Update every second
// Change the quote of the day (sample quotes)
const quotes = [
"The universe is full of stars waiting to be discovered.",
"Look up at the stars and not down at your feet.",
"Stars can't shine without darkness.",
];
function updateQuoteOfTheDay() {
const randomIndex = Math.floor(Math.random() * quotes.length);
quoteOfTheDay.innerText = `"${quotes[randomIndex]}"`;
}
updateQuoteOfTheDay(); // Initial quote
setInterval(updateQuoteOfTheDay, 10000); // Change every 10 seconds
</script>