Onclick pass value to popup modal

Sure! Here’s an example of an HTML code snippet that formats the answer in a div element without the body, h1, and html tags:

“`html

“`

Explanation:

1. We have a button `` with the `onclick` event listener, which triggers the `openModal` function and passes the value `’example’`.
2. Below the button, there is a hidden modal `

Leave a comment