Skip to content

Instantly share code, notes, and snippets.

@johncokos
Created February 19, 2024 20:03
Show Gist options
  • Save johncokos/5e8a2b8efdb79ce8923674ce8496bd4d to your computer and use it in GitHub Desktop.
Save johncokos/5e8a2b8efdb79ce8923674ce8496bd4d to your computer and use it in GitHub Desktop.
Code 201 Lab 01
<!DOCTYPE html>
<html>
<head>
<title>About John</title>
<style>
body {
background: #eee;
}
header {
background: #444;
color: ivory;
padding: 20px;
text-align: center;
}
footer {
background: #ccc;
color: black;
text-align:center;
padding: 10px;
}
main {
margin: 15px;
}
</style>
<script>
function getName() {
// declare a variable called name (let name)
// assign it the value (=)
// returned by the prompt asking for their name
let name = prompt("What is your name?");
document.write( `Hello, ${name}` );
}
</script>
</head>
<body>
<header>
<h1>John</h1>
</header>
<main>
<p>
John is Amazing
</p>
<p>
<script>
getName();
</script>
</p>
</main>
<footer>
&copy; 2024 John
</footer>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment