"html5 native dialog"
Bootstrap 3.3.0 Snippet by uidesigner

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <dialog> <p>Our Terms of Service …</p> <form method="dialog"> <button type="submit" value="yes">Accept</button> <button type="submit" value="no">Reject</button> </form> </dialog>
document.getElementsByTagName("span")[0].addEventListener("click", function() { document.getElementsByTagName("dialog")[0].show(); }, false); document.getElementsByTagName("dialog")[0].addEventListener("click", function() { this.close(); }, false);

Related: See More


Questions / Comments: