-2
I was very confused in the example below:
<!doctype html>
<html lang="pt-br">
<head>
<meta charset="utf-8"/>
<title>Exemplo</title>
</head>
<body>
<details>
<summary>O que é HTTPS?</summary>
<p>
HTTPS é uma implementação do protocolo HTTP sobre uma camada adicional de segurança
que utiliza o protocolo SSL/TLS. Essa camada adicional permite que os dados sejam
transmitidos por meio de uma conexão criptografada e que se verifique a autenticidade
do servidor e do cliente por meio de certificados digitais.
<a href="https://en.wikipedia.org/wiki/HTTPS" target="_blank">Wikipédia</a>
</p>
</details>
<body>
</html>
For within the element <details>
has the <summary>
and the content, when I click to display the content I am clicking on <details>
? as the <summary>
is inside <details>
is for me to be clicking on <details>
since the <details>
is the father of <summary>
, but the content of <summary>
is displayed in front of which of the two I would be clicking?
I still don’t understand, in the case of your code when the
details
is opened is returnedSUMMARY
, but clicking on the already opened content is returnedBODY
being that I’m clicking ondetails
.– joão batista
@joãobatista just read about Document.activeElement, if you do not seek to understand the basics of DOM ai vc gets lost even, the activeElement is a reference to the elements that can receive pointer focus, such as buttons, text fields and links (and Summary itself). Just by clicking on another area only returns BODY because other elements are not "focusable", there only remains the default focus when you click on something that does not accept focus, the default is BODY. Anyway Jean’s answer was to explain that yes, you click on Summary and not DETAILS.
– Guilherme Nascimento
It was bad guy, is that I’m starting in these businesses and do not understand very well how it works things.
– joão batista