Results for “query”
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
Enhance a layout above a minimum viewport width
CSS: A mobile-first min-width query adds columns when enough horizontal space is available.
CSS✓ Tested
Exclude elements from a collection
jQuery: not removes matching elements from the current selection.
jQuery✓ Tested
Expose observation without exposing resolution
jQuery: promise returns an interface without resolve or reject methods.
jQuery✓ Tested
Fade a hidden element into view
jQuery: fadeIn shows a hidden element and calls its completion handler.
jQuery✓ Tested
Fade an element out and hide it
jQuery: fadeOut sets display none after the opacity animation finishes.
jQuery✓ Tested
Fetch a plain-text resource
jQuery: An explicit text data type keeps the response as a string.
jQuery✓ Tested
Fetch and display JSON
jQuery: getJSON parses a successful JSON response.
jQuery✓ Tested
Filter a selection
Reduce a jQuery selection to elements with a matching class.
jQuery✓ Tested
Filter parents containing a matching descendant
jQuery: has retains parents with a matching descendant.
jQuery✓ Tested
Find an element’s position among siblings
jQuery: index without arguments reports a zero-based sibling position.
jQuery✓ Tested
Find descendants
Select only matching descendants of a jQuery container.
jQuery✓ Tested