","learningResourceType":"Practice problem","educationalLevel":"medium","about":"HTML","teaches":"dialog element","url":"https://journeyuncommon.com/quiz/question/030614d2-16f9-4d3d-9a29-c9388c9ca95f","inLanguage":"en","isAccessibleForFree":true,"provider":{"@id":"https://journeyuncommon.com/#organization"},"isPartOf":{"@type":"WebSite","@id":"https://journeyuncommon.com/#website","name":"Journey Uncommon","url":"https://journeyuncommon.com"}}
mediumHTMLdialog elementSingle-choice MCQ Given this dialog, what value does dialog.returnValue hold after the user clicks the Save button, and how does the dialog close?
<dialog id="d">
<form method="dialog">
<button value="cancel">Cancel</button>
<button value="save">Save</button>
</form>
</dialog>
<script>
d.showModal();
d.addEventListener('close', () => console.log(d.returnValue));
</script>