在 Lobsters 上看到「Use cases for <form method="dialog">」這篇,介紹 <form> 的 method="dialog"
,也就是除了 method="get"
與 method="post"
以外,還可以用 method="dialog"
來處理 <dialog> 內的情況:
Indicates the form is intended to close the dialog box in which the form finds itself, if any, and otherwise not submit.
這邊翻了 Can I use 與 MDN 都沒找到支援的時間,所以上 Internet Archive 用 Wayback Machine 找到第一次被收進去的時間點,是 2018 年的年底:「<form> - HTML: HyperText Markup Language | MDN」,算了一下也六年了。
是個有趣的設計,不過不用這個功能也能在 javascript 也是可以實作出效果 (而且也不會很麻煩),留個記錄起來看看之後會不會用到?