When creating functions, we have to think about when and why we need conditional statements inside of them.

For example, anytime you enter a password, a function with a conditional statement decides what message to show you.

<html> <head> <style> body { text-align: center; font-size: 16px; margin: 0 auto; background-color: lightblue; } button { background-color: #85C1E9; border: none; border-radius: 8px; color: white; text-align: center; text-decoration: none; display: inline-block; font-size: 14px; padding: 6px 12px; margin: 0 12px 0 0; } h2 { color: #7c795d; font-family: 'Trocchi', serif; font-size: 45px; font-weight: normal; line-height: 48px; margin: 0; text-align: centre } #playerList { text-align: left; } </style> </head> <body id="main"> <h2>Doober</h2> <p> <label>Password</label> <input id="inputPounds" type="text" placeholder="Password" > </p> <button onClick="convert()">Log in</button> <p> <span id="outputKilograms"></span></p> <script> function convert() { var pounds = document.getElementById("inputPounds").value; if(isNaN(pounds)) { document.getElementById("outputKilograms").innerHTML = "Wrong password!"; } else { document.getElementById("outputKilograms").innerHTML = pounds / 2.2046; } } </script> </body> </html>]]>