At Mozilla, we’re a global community of
working together to keep the Internet alive and accessible, so people worldwide can be informed contributors and creators of the Web. We believe this act of human collaboration across an open platform is essential to individual growth and our collective future.
Read the Mozilla Manifesto to learn even more about the values and principles that guide the pursuit of our mission.
================================================ FILE: scripts/main.js ================================================ // Image switcher code const myImage = document.querySelector("img"); myImage.addEventListener("click", () => { const mySrc = myImage.getAttribute("src"); if (mySrc === "images/firefox-icon.png") { myImage.setAttribute("src", "images/firefox2.png"); } else { myImage.setAttribute("src", "images/firefox-icon.png"); } }); // Personalized welcome message code let myButton = document.querySelector('button'); let myHeading = document.querySelector('h1'); function setUserName() { let myName = prompt('Please enter your name.'); if(!myName) { setUserName(); } else { localStorage.setItem('name', myName); myHeading.innerHTML = 'Mozilla is cool, ' + myName; } } if(!localStorage.getItem('name')) { setUserName(); } else { let storedName = localStorage.getItem('name'); myHeading.innerHTML = 'Mozilla is cool, ' + storedName; } myButton.addEventListener("click", () => { setUserName(); }); ================================================ FILE: styles/style.css ================================================ html { font-size: 10px; font-family: 'Open Sans', sans-serif; } h1 { font-size: 60px; text-align: center; } p, li { font-size: 16px; line-height: 2; letter-spacing: 1px; } html { background-color: #00539F; } body { width: 600px; margin: 0 auto; background-color: #FF9500; padding: 0 20px 20px 20px; border: 5px solid black; } h1 { margin: 0; padding: 20px 0; color: #00539F; text-shadow: 3px 3px 1px black; } img { display: block; margin: 0 auto; }