Skip to content

Instantly share code, notes, and snippets.

@JacobKnaack
Created January 22, 2024 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JacobKnaack/9ee77570d55649a68143269ab3c6c433 to your computer and use it in GitHub Desktop.
Save JacobKnaack/9ee77570d55649a68143269ab3c6c433 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>My first or second website</title>
<style>
h1 {
background-color: blue;
color: white;
}
p {
background-color: red;
color: white;
}
body {
padding: 100px;
}
</style>
</head>
<body>
<header>
<h1>
My Website Header!
</h1>
</header>
<main>
<p>
My Website text
</p>
</main>
<script>
let count = 0;
let question = 'How are you?';
let answer = prompt(question); // ask the user something, and return what they type.
let userLovesJS = confirm("Do you love JS??"); // ask the user something they can yes / no
if (userLovesJS) {
alert('Great, me too!');
} else {
alert('Aww thats too bad :(');
}
document.write(answer); // outputs something the actual website;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment