確認ダイアログconfirmを表示させる。 表示方法 状況によって書き方は変わるが、昔からある書き方は以下の様な感じ。 <input type='submit' value='送信' onclick='return confirm("本当に移動しますか");'/> 複雑な条件分岐がある場合、JavaScript の方は別に書いた方が良い。
「リンク」をクリックして表示するダイアログの例です。 前回のボタンのものがリンクに変わっただけで簡単です。 ボタンの時と同じように「id属性」を付与しているだけです。 これで同じ方法でconfirmを使ったダイアログを表示することができます。
「ボタン」をクリックして表示するダイアログの例です。 単純に「button要素」を作って配置しているだけです。 フォーム要素の「inputタグ」を代用してもOKです。 あとは、buttonタグの「id属性」を使ってボタン要素を取得し、イベント処理を実装するだけです ...
Add a description, image, and links to the confirm-dialog topic page so that developers can more easily learn about it.
"The library exposes three methods designed to mimic their native JavaScript equivalents. Their exact method signatures are flexible as each can take various parameters to customize labels and specify ...