Posts

Javascript DOM Selector and Manipulation

DOM Selector Method

  • document.getElementById() returns one element with the id
  • document.getElementsByClassName() returns a node list (not an array)
  • document.getElementsByTagName() returns a node list (not an array)
  • document.querySelector() returns the first match

DOM Manipulation

change style

  • el.style.color = ‘blue’;
  • el.style.marginTop = ‘200px’;

change CSS Class to an element

  • el.classList.add(‘CSSclassname’);
  • el.classList.remove(‘CSSclassname’);
  • el.classList.toggle(‘CSSclassname’);

What is execution Context in Javascript?

Execution context is a very important concept in Javascript. The article is for me to try to explain it so that it deepens my understanding.

  • Global Execution Context Global Execution Context creates a global object (window object). The ‘this’ keyword in global execution context refers to the global object. Global execution context is not inside a function

  • Hoisting

Functional Programming

functional programming

Javascript Interview Questions

some common Javascript interview questions