-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
25 lines (18 loc) · 870 Bytes
/
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
document.getElementById('commentForm').addEventListener('submit', function(event) {
event.preventDefault();
// Get the comment value
const comment = document.getElementById('comment').value;
// Create a new paragraph element
const newComment = document.createElement('p');
newComment.textContent = comment;
// Append the new comment to the comments display section
document.getElementById('commentsDisplay').appendChild(newComment);
// Clear the textarea
document.getElementById('comment').value = '';
});
document.getElementById('giftForm').addEventListener('submit', function(event) {
event.preventDefault();
const amount = document.getElementById('amount').value;
const currency = document.getElementById('currency').value;
alert(`Thank you for your gift of ${amount} ${currency}!`);
});