Show a minimal vanilla JS/HTML example of a modal dialog with a title, some short description and 3 button choices using the builtin dialog element and the builtin function showModal.
Modals would exist as elements on the page, with data-attributes configuring whether the modal can be cancelled (data-cancel-action?) and the action for each button present..
The outer interface using it should be an async function that returns the action.
The CSS should be written in a way it doesn't break other styles on the page.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Below is a minimal vanilla JavaScript/HTML example of a modal dialog using the built-in <dialog> element and the showModal() function. The modal includes a title, a short description, and three button choices. It uses data- attributes for configuration and an async function to return the selected action.