Tag view

#dom

Cross-subject tag search for related interview cards.

Clear

Results update as you type. Press / to jump straight into search.

Tagged with dom

2 cards

JavaScript Medium Theory

DOM basics: DOM selection, querySelector, querySelectorAll, getElementById, traversal, manipulation, createElement, appendChild, removeChild, and innerHTML vs textContent

The DOM is the browser's tree representation of the page, and JavaScript can select, traverse, and update nodes through several APIs.

  • Selectors return elements or node lists
  • DOM manipulation changes the page tree
  • `textContent` is safer than arbitrary `innerHTML`

DOM basics: DOM selection, querySelector, querySelectorAll, getElementById, traversal, manipulation, createElement, appendChild, removeChild, and innerHTML vs textContent

JavaScript Medium Theory

Events in JavaScript: event handling, addEventListener, bubbling, capturing, delegation, preventDefault, and stopPropagation

Browser events travel through capture and bubble phases, and good event handling often relies on delegation and controlled propagation.

  • `addEventListener` can listen in capture or bubble phase
  • Delegation reduces many per-node listeners
  • `preventDefault` and `stopPropagation` solve different problems

Events in JavaScript: event handling, addEventListener, bubbling, capturing, delegation, preventDefault, and stopPropagation