Results for “attribute”
Small, practical examples. Search by task or narrow things down below.
Distinguish current state from initial markup
jQuery: prop reads the live checked state; attr reads the original checked attribute.
jQuery✓ Tested
Allow one disclosure in a named group to stay open
HTML: Matching details name attributes create an exclusive native accordion in supporting browsers.
HTML✓ Tested
Associate a control outside the form element
HTML: The form attribute links an external named control to the form’s ID.
HTML✓ Tested
Associate a data cell with explicit table headers
HTML: The headers attribute lists header IDs for a more complex cell association.
HTML✓ Tested
Block scripts in an embedded document
HTML: An empty sandbox attribute applies the default set of restrictions, including blocking script execution.
HTML✓ Tested
Continue an ordered list at a chosen number
HTML: The start attribute controls the initial ordinal without changing item text.
HTML✓ Tested
Count an ordered list downward
HTML: The reversed attribute changes the native numbering direction.
HTML✓ Tested
Disable a button
Set the live disabled property with jQuery prop.
jQuery✓ Tested
Escape text for HTML content
Python: Use html.escape before placing plain text in an HTML text or quoted attribute context.
Python✓ Tested
Expand an abbreviation with explanatory text
HTML: The title attribute supplies the full form while nearby text remains useful without hovering.
HTML✓ Tested
Find the commit responsible for a line
Inspect line attribution in a stable machine-readable format.
blame✓ Tested
Find the nearest matching ancestor
Read a parent row attribute using jQuery closest.
jQuery✓ Tested