niutech / showModalDialog

window.showModalDialog polyfill using a <dialog> element
https://niutech.github.io/showModalDialog/demo.html
Apache License 2.0
177 stars 88 forks source link

Set id attribute to dialog window #51

Open svbfromnl opened 4 years ago

svbfromnl commented 4 years ago

Adding an id attribute to the iframe will allow you to manipulate the iframe from inside. For example: you can add a button to the html with an onclick() event that does something like this: window.parent.document.getElementById('modalDialog').close();