Looks like you need to learn and practice programming.
Advice: follow tutorials and practice.
Your code is overcomplicated
function ConfirmDelete()
{
var x = confirm("Are you sure you want to delete?");
if (x==true)
{
return true;
}
else
return false;
}
can be simplified to
function ConfirmDelete()
{
var x = confirm("Are you sure you want to delete?");
return x;
}
and even to
function ConfirmDelete()
{
return confirm("Are you sure you want to delete?");
}