Results for “element”
Small, practical examples. Search by task or narrow things down below.
Read the first collection element
C: Access index zero only after establishing that the collection is nonempty.
C✓ Tested
Read the last array element
PowerShell: A negative array index counts backward from the end.
PowerShell✓ Tested
Remove a hidden element’s layout space
CSS: Display none removes a box from layout as well as hiding its contents.
CSS✓ Tested
Remove an indexed element and compact the array
Bash Scripts: Unsetting an element leaves a gap; reassigning the values creates consecutive indices.
Bash Scripts✓ Tested
Remove matching elements
Remove selected list items from the DOM with jQuery.
jQuery✓ Tested
Remove one array element and close the gap
C: memmove handles the overlap while the logical length shrinks by one.
C✓ Tested
Remove one selected element
jQuery: Learn how to remove one selected element in a complete browser example.
jQuery✓ Tested
Replace an element while preserving its position
jQuery: replaceWith swaps an entire node.
jQuery✓ Tested
Replace one collection element
Python: Update an existing element at a known valid index.
Python✓ Tested
Replace one collection element
C#: Update an existing element at a known valid index.
C#✓ Tested
Replace one collection element
Java: Update an existing element at a known valid index.
Java✓ Tested
Replace one collection element
JavaScript: Update an existing element at a known valid index.
JavaScript✓ Tested