Results for “Refs & DOM interaction”
Small, practical examples. Search by task or narrow things down below.
Display a label in uppercase without changing its text
CSS: Text-transform changes visual casing while preserving the DOM’s source text.
CSS✓ Tested
Display code as text
Escape angle brackets in preformatted HTML code samples.
HTML✓ Tested
Group mutually exclusive choices
Use the same name for HTML radio buttons and a fieldset legend.
HTML✓ Tested
Hide and show content
Use a button to toggle jQuery visibility and an accessibility state.
jQuery✓ Tested
Include padding in element width
Use border-box to keep CSS padding and borders inside the declared width.
CSS✓ Tested
Label a data table
Use a caption and scoped headers for an HTML data table.
HTML✓ Tested
Link to a page section
Use a fragment link to target an HTML section on the same page.
HTML✓ Tested
Mark up a machine-readable date
Pair a readable date with an ISO datetime attribute in HTML.
HTML✓ Tested
Name an icon button
Give a button containing only a symbol an accessible name.
HTML✓ Tested
Offer a selection list
Provide a labeled HTML select with a default option.
HTML✓ Tested
Open a link in a separate tab
Declare a separate browsing context with an explicit noopener relationship.
HTML✓ Tested
Pair terms and descriptions
Use a description list for a small HTML glossary.
HTML✓ Tested