<!DOCTYPE html>
<html>
<head>
<title>ToDo List</title>
<link rel="stylesheet" href="css/style.css" />
<meta charset="utf-8" />
</head>
<body>
<div class="box">
<h1>Todo List</h1>
</div>
<div class="box2">
<!--<% for(var i=0; i< dayej.length; i++ ) { %>-->
<% dayej.forEach(function(items){ %>
<form action="/delete" method="POST">
<div class="item">
<input
type="checkbox"
value="<%= items._id %>"
name="checkbox1"
onchange="this.form.submit()"
/>
<!-- <p><%= dayej[i].name%></p>-->
<p><%=items.name%></p>
</div>
</form>
<% }) %>
<form class="item" action="/" method="POST">
<input type="text" name="ele1" placeholder="Enter the task" />
<button type="submit">+</button>
</form>
</div>
</body>
</html>
TO delete the elements and without giving any errors its a todo list where I want to delete and add elements is list so that it can be given and thus running a for loop for each of it
please you should review the JavaScript code within your template and check for any syntax errors. The specific error "Unexpected token 'catch'" might indicate an issue with the usage of a try-catch block or a similar construct in your code.