function remove(current) {
let text = "Are You Sure ?";
if (confirm(text) == true) {
current.parentElement.parentElement.remove();
// document.getElementById("tablebody1").deleteRow(element.parentNode.rowIndex);
text33 = JSON.parse(localStorage.getItem("storex"))
function rem(arr, index) {
return arr.filter(function(ele) {
return ele != index
})
}
localStorage.setItem('text32', JSON.stringify(result));
localStorage.getItem("text32")
}
}
I am trying to delete the items from my localstorage I render the table data on the screen but my table data is coming into the localstorage i want to delete particular item for example:
if i have localstorage just like that
0: {namex: "ANUJ", lnamex: "ANUJ", emailx: "anuj123@gmail.com"}
1: {namex: "ANUJ", lnamex: "ANUJ", emailx: "anuj123@gmail.com"}
2: {namex: "ANUJ", lnamex: "ANUJ", emailx: "anuj123@gmail.com"}
3: {namex: "ANUJ", lnamex: "ANUJ", emailx: "anuj123@gmail.com"}
4: {namex: "ANUJ", lnamex: "ANUJ", emailx: "anuj123@gmail.com"}
5: {namex: "ANUJ", lnamex: "ANUJ", emailx: "anuj123@gmail.com"}
6: {namex: "rohit", lnamex: "ANUJ", emailx: "anuj123@gmail.com"}
let say I want to delete 6 items. How can i do so or if i delete it when I refresh the page it come again