运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1 id="demo"></h1> <script> function renderApp() { document.getElementById("demo").innerHTML = "Welcome!"; } function renderLogin() { document.getElementById("demo").innerHTML = "Please log in"; } let authenticated = true; authenticated ? renderApp() : renderLogin(); </script> <p>Try changing the "authenticated" variable to false, and run the code to see what happens.</p> </body> </html>