cleanup
This commit is contained in:
parent
534252fbfa
commit
04f761b6f7
@ -1,25 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head> <title>Complete JavaScript Course</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<input type="text" id="addItem">
|
||||
<input type="button" id="addNew" value="Add to List">
|
||||
</div>
|
||||
<h1>Shopping List</h1>
|
||||
<ol id="sList"> </ol>
|
||||
|
||||
<script>
|
||||
const myItem = document.querySelector('#addItem');
|
||||
const btn = document.querySelector('#addNew');
|
||||
const myList = document.querySelector('#sList');
|
||||
btn.addEventListener('click', (e) => {
|
||||
let val = myItem.value;
|
||||
const li = document.createElement('li');
|
||||
li.textContent = val;
|
||||
myList.append(li);
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user