I just want to delete the last paragraph on the page, when I press a button. My code just causes an invalid argument error. I'm new to this so can anyone tell me what I'm doing wrong?

function DelLastItem() {
allParas = document.getElementsByTagName("p");
killPara =allParas.item(allParas.length-1);
docBody = document.getElementsByTagName("body").item(0);
erasePara = docBody.removeChild(killPara);
}
Any advice would be great, Thank You