sigil88
1/22/2017 - 4:45 PM

Simple vanilla JS equivalents to basic jquery:

Simple vanilla JS equivalents to basic jquery:

// instead of jquery addClass, try:

// save item in variable
const key 	= document.querySelector(`.key[data-key="${e.keyCode}"`);

// add class to selected item
key.classList.add('playing');

// equivalents for remove, toggle:
key.classList.remove('playing');
key.classList.toggle('playing');

// and so on....