How to interact with an html button element while a dialog element is open

I have a web page with html dialog element and there is a button on the page, how to enable interacting on the page elements while the dialog element is open. Example:

document.getElementById("myDialog")?.showModal();
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Dialog Example</title>
  </head>
  <body>
    <dialog id="myDialog">
      <p>
        Lorem ipsum dolor sit, amet consectetur adipisicing elit. Laborum
        corporis, fugit ullam accusantium porro quasi.
      </p>
    </dialog>

    <button onclick="alert('button clicked')">Click</button>
  </body>
</html>