You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As it stands the <dialog> element requires javascript. Would it make sense to have an attribute, similar to the for attribute in labels, that allows you to make a button a toggle or opener for a <dialog>?
Currently, I do something like this
<buttondata-for-dialog="testDialog" open>Open dialog</button><dialogid="testDialog"><h1>An example of a native Dialog element</h1><p>This is a dialog box and, believe it or not, it's built into HTML, sure we needed some javascript to open it but hey, it's a start.</p><buttondata-for-dialog="testDialog" close>Close dialog</button></dialog>
I think it would be helpful to be able to do something like this and have it work.
<buttonfor-dialog="testDialog" open>Open dialog</button><dialogmodalid="testDialog"><h1>An example of a native Dialog element</h1><p>This is a dialog box and, believe it or not, it's built into HTML, sure we needed some javascript to open it but hey, it's a start.</p><buttonfor-dialog="testDialog" close>Close dialog</button></dialog>
We were discussing the element over on dev.to
Thanks for your time 🙂
The text was updated successfully, but these errors were encountered:
As it stands the
<dialog>
element requires javascript. Would it make sense to have an attribute, similar to the for attribute in labels, that allows you to make a button a toggle or opener for a<dialog>
?Currently, I do something like this
and then have some JS like so
I think it would be helpful to be able to do something like this and have it work.
We were discussing the element over on dev.to
Thanks for your time 🙂
The text was updated successfully, but these errors were encountered: