Skip to content

Commit

Permalink
added input list mini-project
Browse files Browse the repository at this point in the history
  • Loading branch information
nmoxeyumich committed Oct 4, 2024
1 parent bf5c4b6 commit 799303a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions students/nmoxey/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nate's Landing Page</title>
<script src="main.js"></script>
</head>
<body>
<div class="Centered">
Expand All @@ -31,5 +32,13 @@ <h1 class="PageHeading">mrbrbrn.com</h1>
</ul>
</div>
</div>
<div class="Centered">
<p class="PageHeading">What's your favorite game?</p>
<ol id="lis" class="PageHeading">
<li>Castle Crashers</li>
</ol>
<input id="inp"/>
<button id="button" onclick="putInList()">Submit</button>
</div>
</body>
</html>
7 changes: 7 additions & 0 deletions students/nmoxey/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
putInList = function() {
let inp = document.getElementById("inp").value;//get input text
let ul = document.getElementById("lis");//get list
let entry = document.createElement('li');
entry.appendChild(document.createTextNode(inp));
ul.appendChild(entry);
}

0 comments on commit 799303a

Please sign in to comment.