[A] change
[B] close
[C] toggle
[D] open
The correct answer is C) toggle.
<details id="details">
<summary>toggle event</summary>
</details>
<script>
let details = document.querySelector("#details")
details.addEventListener("toggle", function() {
details.firstChild.textContent = "done"
})
</script>
The toggle event is fired when the user opens or closes the <details> element. This event can be used to trigger a variety of actions, such as displaying additional information or showing a different content.
Comments (0)