I have an array containing four element located in local storage.
function rm(t)
{
// var l = localStorage.getItem("subje");
// hide element from html page
document.getElementById(t).style.display = 'none';
var c = localStorage.getItem("class");
var item = c+""+t; // c is int and t is string
var subj = localStorage.getItem("std-sub");
var x = subj.indexOf(item);
/*
subj.splice(x,1);
localStorage.setItem("final", subj);
var k = localStorage.getItem("final");*/
document.getElementById('show').innerHTML = x;
}
when I executing function the value of x is showing 29,17,7,0. but my given array have only four element. why?????