-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
35 lines (31 loc) · 1.3 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
document.getElementById('add-task-btn').addEventListener('click', function() {
const taskInput = document.getElementById('task-input');
const taskList = document.getElementById('task-list');
if (taskInput.value.trim() !== "") {
const newTask = document.createElement('li');
newTask.textContent = taskInput.value;
taskList.appendChild(newTask);
taskInput.value = '';
}
});
document.getElementById('save-note-btn').addEventListener('click', function() {
const noteInput = document.getElementById('note-input');
const noteList = document.getElementById('note-list');
if (noteInput.value.trim() !== "") {
const newNote = document.createElement('li');
newNote.textContent = noteInput.value;
noteList.appendChild(newNote);
noteInput.value = '';
}
});
document.getElementById('add-goal-btn').addEventListener('click', function() {
const goalInput = document.getElementById('goal-input');
const goalList = document.getElementById('goal-list');
if (goalInput.value.trim() !== "") {
const newGoal = document.createElement('li');
newGoal.textContent = goalInput.value;
goalList.appendChild(newGoal);
goalInput.value = '';
}
});
// You can later add functionality for fetching weather from an API, etc.