FAQ

nodeValue vs innerHTML vs textContent vs innerText . How to choose? +

Summary

  1. nodeValue is a little more confusing to use, but faster than innerHTML.
  2. innerHTML parses content as HTML and takes longer.
  3. textContent uses straight text, does not parse HTML, and is faster.
  4. innerText Takes styles into consideration. It won't get hidden text for instance.

innerText didn't exist in firefox until FireFox 45 according to caniuse but is now supported in all major browsers.

  +

  +

setInterval vs setTimeout +

setInterval fires again and again in intervals, while setTimeout only fires once.setTimeout(): It is a function that execute a JavaScript statement AFTER x interval.setTimeout(function () { something(); }, 1000); // Execute something() 1 second later
setTimeout(function () {
    something();
}, 1000); // Execute something() 1 second later.

setInterval(function () {
    somethingElse();
}, 2000); // Execute somethingElse() every 2 seconds.

Footer section 1

Content for the first footer section.

Footer section 2

Content for the second footer section.

Footer section 3

Content for the third footer section.