Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="dropdownmeny.css">
- <h1>Javascript</h1>
- </head>
- <body>
- <p></p>
- <nav>
- <ul>
- <li><a href="#">Font-size</a>
- <ul>
- <li><a href="#" onclick="liten()">15px</a></li>
- <li><a href="#" onclick="medium()">20px</a></li>
- <li><a href="#" onclick="stor()">25px</a>
- </ul>
- </li>
- <li><a href="#">Font-type</a>
- <ul>
- <li><a href="#">Verdana</a></li>
- <li><a href="#">Times New Roman</a></li>
- <li><a href="#">Arial</a></li>
- </ul>
- </li>
- <li><a href="#">Bakgrunnsfarge</a>
- <ul>
- <li><a href="#">Rosa</a></li>
- <li><a href="#">Turkis</a></li>
- <li><a href="#">Gul</a></li>
- </ul>
- </li>
- </ul>
- </nav>
- <p id=tekst style="background-color:pink; font-size: 15px; font-family: verdana">This text should change</p>
- <script>function liten() {document.getElementById("tekst").style.font-size = "15px"; }</script>
- <script>function medium() {document.getElementById("tekst").style.font-size = "20px"; }</script>
- <script>function stor() {document.getElementById("tekst").style.font-size = "25px"; }</script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement