I'm trying to store in array using onclick on checkbox input code is shown below :
function CheckBoxShortList(x,y,z)
{
var slide = '';
var arr = [];
arr.push = x + ',' + y + ',' + z;
console.log(arr);
}
CheckBox code is below :
<input type="checkbox" onclick="CheckBoxShortList('@item.Cid','@item.Hid','@k');">
It shows current value on console.log(arr) which is okay but if i use console.log(arr.length) then it is 0 not incrementing.
Also i want to remove from array as i uncheck the input box.*