Loading tutorials
html, head, body, paragraphs, lists) and that you know what a child element is. You don't need CSS or JavaScript yet. Later chapters cover the open attribute, styling, scripting and accessibility in detail. This chapter is about the struc7 min readopen attribute on <details>. It decides whether the widget starts expanded, and the browser keeps it in sync as the user interacts. You should already know the basic <details> and <summary> structure from the previous chapter, plus basic HTML, CSS selectors, and selec9 min read<summary> and inside the rest of <details>, and what the browser does with content that breaks the rules. It assumes you can already write a basic <details> element with a <summary> and know how the open attribute works. You should also be comfor8 min readdetails element with a summary child and know that the browser adds an open attribute when the widget expands. Here you will style three parts of the widget: the summary row, the marker (the discl7 min readdetails and summary widget, and that you know what the open attribute does. It also assumes you can select elements with querySelector and add event listeners. Here you will read and change the open state from a script, and you will see which pitfal7 min readdetails and summary widget, know how the open attribute and the open property relate, and can attach event listeners in JavaScript. The toggle event is how your code finds out that a disclosure widget changed state. It looks simple, but its timing and p7 min readdetails elements can behave as an accordion, where opening one panel closes the others, using a single attribute and no script. This chapter covers how the grouping works, how it interacts with the open attribute, the open property and the toggle event, and where it breaks down.8 min readdetails and summary behave for people who don't use a mouse. It also covers what assistive technology is told about the widget, and what breaks that behavior. It assumes you can already build a basic disclosure widget, set open, and style summary with CSS. It also ass9 min readdetails elements. Here you decide when that toolkit is the right choice and when a custom component is justified.7 min read