Variabel lewat dalam tabel baris menghapus tombol node JS Express
<button class="delete-button" onclick="deleting(<%= item._id %>)">X</button>
function deleting(value){
fetch('/delete', { method: 'POST', data: {buttonId: value} })
.then(function (response) {
if (response.ok) {
console.log('Delete was recorded')
return
}
throw new Error('Request failed.')
})
.catch(function (error) {
console.log(error)
})
Tender Thrush