-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (21 loc) · 755 Bytes
/
script.js
File metadata and controls
24 lines (21 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const notationInput = document.getElementById('notation-input');
const addNotationBtn = document.getElementById('add-notation-btn');
const notationList = document.querySelector('.notation-list');
let notations = []; // Store notations as an array of strings
addNotationBtn.addEventListener('click', () => {
const notationText = notationInput.value.trim();
if (notationText) {
notations.push(notationText);
displayNotations();
notationInput.value = '';
}
});
function displayNotations() {
notationList.innerHTML = '';
notations.forEach(notation => {
const listItem = document.createElement('li');
listItem.classList.add('notation-item');
listItem.textContent = notation;
notationList.appendChild(listItem);
});
}