|
| 1 | +function changeHeading() { |
| 2 | + const options = [ |
| 3 | + "The only way to do great work is to love what you do. - Steve Jobs", |
| 4 | + "Strive not to be a success, but rather to be of value. - Albert Einstein", |
| 5 | + "The future belongs to those who believe in the beauty of their dreams. - Eleanor Roosevelt", |
| 6 | + "It does not matter how slowly you go as long as you do not stop. - Confucius", |
| 7 | + "Our greatest glory is not in never failing, but in rising up every time we fail. - Ralph Waldo Emerson", |
| 8 | + "The journey of a thousand miles begins with a single step. - Lao Tzu", |
| 9 | + "Believe you can and you're halfway there. - Theodore Roosevelt", |
| 10 | + "Success is not final, failure is not fatal: it is the courage to continue that counts. - Winston S. Churchill", |
| 11 | + "What you get by achieving your goals is not as important as what you become by achieving your goals. - Zig Ziglar", |
| 12 | + "The best way to predict the future is to create it. - Peter Drucker", |
| 13 | + ]; |
| 14 | + const randomIndex = Math.floor(Math.random() * options.length); |
| 15 | + document.getElementById("domHeading").innerText = options[randomIndex]; |
| 16 | +} |
| 17 | + |
| 18 | +function addNewParagraph() { |
| 19 | + const p = document.createElement("p"); |
| 20 | + p.innerText = "This is a new paragraph!"; |
| 21 | + document.getElementById("domContent").appendChild(p); |
| 22 | +} |
| 23 | +document.addEventListener("DOMContentLoaded", function () { |
| 24 | + const darkModeButton = document.getElementById("darkmodetoggle"); |
| 25 | + const toggleDarkModeImage = document.getElementById("toggle-dark-mode"); |
| 26 | + darkModeButton.addEventListener("click", function () { |
| 27 | + toggleDarkModeImage.click(); |
| 28 | + }); |
| 29 | +}); |
0 commit comments