Dialog Element

Use <dialog> for modals without JS libraries.

This is a native dialog!

Code Example


  

  <button onclick="document.getElementById('myDialog').showModal()">Open Dialog</button>    
   
  <dialog id="myDialog">
        <p>This is a native dialog!</p>
        <button onclick="document.getElementById('myDialog').close()">Close</button>
  </dialog>

  
Dialog Demo