Riepilogo eventi

Attributo gestore da aggiungere all’elemento <elemento gestore="funzione(...)">...</elemento> per far eseguire la funzione corrispondente, eventualmente dotata di parametri

  • onclick
  • onmousemove
  • onmouseover
  • onmouseout
  • onmousedown
  • onload

evt

  • evt.target
  • evt.clientX
  • evt.clientY

Metodi per il documento document.metodo(...)

  • rootElement
  • getElementById(“…”)
  • createElement(“…”), createElementNS(“…”),
  • appendChild(…)
  • removeChild(…)
  • replaceChild(…, …)

Metodi per gli elementi elemento.metodo(...)

  • getAttribute(“…”)
  • setAttribute(“…”, “…”)
  • hasAttribute(“…”)
  • removeAttribute(“…”)
  • addEventListener(“…”, funzione, false)

Restituiscono un nodo

  • parentNode
  • firstChild
  • nextSibling

Restituisce i nodi

  • childNodes
    • childNodes.length
    • childNodes.item(i)
      • childNodes.item(i).nodeName
      • childNodes.item(i).nodeValue

Lascia un commento