-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotification.js
29 lines (26 loc) · 1.1 KB
/
notification.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
const formSubmissionsString = localStorage.getItem("formSubmissions");
const submissionTable = document.getElementById("submissionTable");
const messageCount = document.getElementById("messageCount");
if (formSubmissionsString) {
// Parse form submissions from JSON string
const formSubmissions = JSON.parse(formSubmissionsString);
// Populate table with form submissions
/*var number_messages = formSubmissions.length;
messageCount.textContent = number_messages;*/
var counts=document.querySelector("#msegs");
counts.innerHTML = formSubmissions.length;
formSubmissions.forEach((formData, index) => {
const row = document.createElement("tr");
row.innerHTML = `
<td>${index + 1}</td>
<td>${formData.name}</td>
<td>${formData.email}</td>
<td>${formData.message}</td>
<td><button><a href=mailto:${
formData.email
}>Reply</a></button> </td>
<td><button onclick="deleting(${index})">Delete</button></td>
`;
submissionTable.appendChild(row);
});
}