FIND YOUR NEXT FEW LINES
Results for “Java”
Small, practical examples. Search by task or narrow things down below.
257 snippets foundClear filters
Create a native disclosure
Use details and summary to show optional HTML content without JavaScript.
HTML✓ Tested
Safely read a caught error
Check the error type before accessing its message.
unknown✓ Tested
Start a disclosure open while keeping it collapsible
HTML: The open attribute sets the initial details state without JavaScript.
HTML✓ Tested
Store an object associated with an element
jQuery: data retains JavaScript values without serializing them into HTML attributes.
jQuery✓ Tested
Transform a collection into a plain array
jQuery: map followed by get returns ordinary JavaScript values.
jQuery✓ Tested