Js confirm delete dialog box applies to a label and submit

  • 2020-03-30 03:32:19
  • OfStack

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
<title>js Confirm the delete dialog box </title> 
</head> 

<body> 
<p> 
<script language="javascript"> 
function delcfm() { 
if (!confirm(" Are you sure you want to delete? ")) { 
window.event.returnValue = false; 
} 
} 
</script> 
<a href="//"Www.jb51.net/" onClick = "delcfm ()> Delete </ a> </ p>
<p> Code description: it is executed after clicking the deleted hyperlink delcfm() Function. In the dialog box, if you click ok, the function returns true Value, which takes the page to <a> The linked page in the tag performs the deletion of the page; If you click cancel, the function returns false Value, <a> The TAB will not go to the page where the deletion was performed. </p> 
<p> To find more code, visit: <a href=//www.jb51.net target = "_blank"> Script house </ a> </ p>
</body> 
</html>

 


Related articles: