HTML 5.2: The Element

HTML 5.2 has introduced a new element to show modal dialog boxes. Here’s a small demo by @bdc :

Already available in Chrome; a polyfill is available for other/older browsers.

Meet the New Dialog Element →

Polyfill for the HTML element →

Siderant: I cannot help it, but my inner geek has issues with the language used to control the dialog. The attribute to indicate whether a modal is open/visible/shown or not is named open , so I guess that’s the baseline.

Now, say you want to open a modal via JavaScript you have to call modal.showModal() … why show and not open to be in line with the HTML attribute? And why the Modal suffix?

And now comes the even more inconsistent part: to close it, you don’t call

(which is the exact opposite of

) nor

, but


Weird …

Elsewhere dialog , html , link , modal

稿源 (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 前端开发 » HTML 5.2: The Element

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录