Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- document.addEventListener("DOMContentLoaded", function() {
- var options = document.querySelectorAll("option")
- var images = document.querySelectorAll(".page-header > img")
- for (let image of images) {
- image.style.display = "none";
- }
- document.querySelector(".form-control").addEventListener("change", function() {
- for (var i = 0; i < options.length; i++) {
- console.log(i)
- if(options[i].selected){
- images[i].style.display = "block";
- } else {
- images[i].style.display = "none";
- }
- }
- });
- });
Add Comment
Please, Sign In to add comment