because the confirm only had two value. one is true. and other is flase.
Try the codes below :--------------------------------------------------------------- <input type="button" name="button" value="Click to Confirm" onclick="if (confirm('Are you sure to Del the item ?')){alert('You Clicked : \nYes');return false;}else{alert('You clicked : \nNo');return false;}"> ---------------------------------------------------------------
window.alert("You click yes!);
else
window.alert("You click no!);
else alert("取消");
<input type="button" name="button" value="Click to Confirm" onclick="if (confirm('Are you sure to Del the item ?')){alert('You Clicked : \nYes');return false;}else{alert('You clicked : \nNo');return false;}">
---------------------------------------------------------------