Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions pre-class/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!DOCTYPE html>
<html>
<head>
<title>Basics</title>
<style>
* {
box-sizing: border-box;
}

body {
font-family: sans-serif;
margin-left: 30px;
margin-right: 30px;
}

#header {
text-align: center;
}

#container {
background-color: pink;
margin: 40px auto;
max-width: 800px;
padding: 38px 31px;
}

input {
font-size: 21px;
line-height: 33px;
margin: 0 0 23px 0;
padding: 0 9px;
width: 74%;
}

button {
font-size: 21px;
line-height: 33px;
margin: 0 0 23px 0;
padding: 0 6px;
width: 25%;
}

#output-div {
background-color: lightgrey;
margin: 20px auto;
padding: 20px;
width: 100%;
}
</style>
</head>

<body>
<h1 id="header">Basics! 🚀</h1>
<div id="container">
<p>Input:</p>
<input id="input-field" />
<button id="submit-button">Submit</button>
<p>Output:</p>
<div id="output-div"></div>
</div>
<!-- Import program logic -->
<script src="script.js"></script>
<!-- Define button click functionality -->
<script>
var button = document.querySelector("#submit-button");
button.addEventListener("click", function () {
// Set result to input value
var input = document.querySelector("#input-field");
var result = main(input.value);

// Display result in output element
var output = document.querySelector("#output-div");
output.innerHTML = result;

// Reset input value
input.value = "";
});
</script>
</body>
</html>
Loading