Intermediate
A delete confirmation dialog
Add a dialog that asks Delete this photo?. Inside it, use a <form method="dialog"> with two buttons: Cancel (value="cancel") and Delete (value="delete").
In JavaScript, clicking the Delete photo button must open the dialog as a modal.
When the dialog closes, set the text of #status to Deleted if its returnValue is delete, and to Kept otherwise.
What Check tests
- There is a
dialog, closed when the page loads - It has a
formwithmethod="dialog"and Cancel/Delete buttons - Clicking Delete photo opens it as a modal
- Closing with
deleteshowsDeleted - Closing with
cancelshowsKept
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.