27 February 2017

Javascript | Important functions

  • document.querySelctor('.class_name') using query selector you can grab the html tags by its class
  • example of query selector and event listener within a module
    'click' in above example is the type of listener. You can find any kind of listener on this event reference
  • To add an event listener to any key of a keyboard e.g. 'Enter' (13) key, you can do it like this:
  • change keyCode to any code of the keyboard.
    You can find the code of any key of your keyboard from keycode.info

No comments:

Post a Comment