CKTIS / HTML
HTML-element: address
Het contactelement identificeert contactgegevens van auteur of eigenaar van de dichtstbijzijnde zelfstandige sectie, niet elk postadres.
Versie: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<address>contact information for the nearest article or body</address>address hoort bij de dichtstbijzijnde voorouder article, of zonder die bij document-body; het beschrijft geen ongerelateerde personen.
Het inhoudsmodel van address sluit koppen en sectionerende inhoud uit; ook verbiedt het afstammelingen address, header en footer.
Het kan naam, organisatie en werkende mailto:- of tel:-links bevatten; een plaatsadres zonder contactrol vereist het niet.
Het voorbeeld plaatst address in een artikel, gebruikt closest() voor de eigenaar en observeert het schema mailto:.
Voorbeelden
<!doctype html>
<meta charset="utf-8">
<article id="release">
<h2>Release notes</h2>
<address id="contact">Maintained by <a href="mailto:docs@example.test">Documentation team</a></address>
</article>
<output id="result"></output>
<script>
const contact = document.querySelector("#contact");
const link = contact.querySelector("a");
document.querySelector("#result").textContent = `owner=${contact.closest("article").id}; links=${contact.querySelectorAll("a").length}; scheme=${link.protocol}; text=${link.textContent}`;
</script>
Resultaat
owner=release; links=1; scheme=mailto:; text=Documentation team
Het resultaat bevestigt DOM-relatie en contact-URL; het verzendt niets en beoordeelt geen volledigheid.