사용자가 요소를 열거나 닫을 때 ontoggle 이벤트 화재. 다음 코드를 실행하여 ontoggle을 구현할 수 있습니다. 이벤트 속성 -
예시
<!DOCTYPE html>
<html>
<body>
<h2>Details</h2>
<p>You need to join office from Feb23<p>
<details ontoggle="display()">
<summary>More Information</summary>
<p>Timings: 9 to 5:30</p>
<p>Office location: Hyderabad</p>
</details>
<script>
function myFunction() {
alert("Timings, office location, etc");
}
</script>
</body>
</html>