DOM - xuanz1993/JS GitHub Wiki

  1. Content interaction
  • textContent - This returns just the text
  • innerHTML - This returns the actual html
  • getAttribute() - This returns the original attribute
  • setAttribute() - This allows to set the attribute
  1. Event
myvariable.addEventListener('event', 'function');
  • Events: clicks, hovers, double clicks, drags ......