var comf =confirm("确定需要删除吗"); comf ?delete_task(index):null; 转载于:https://www.cnblogs.com/fpcbk/p/9602384.html