Skip to content

Instantly share code, notes, and snippets.

@nickeforsberg
Created December 16, 2019 10:38
Show Gist options
  • Save nickeforsberg/cbc8d1c084cb23124d0c002d87ff8290 to your computer and use it in GitHub Desktop.
Save nickeforsberg/cbc8d1c084cb23124d0c002d87ff8290 to your computer and use it in GitHub Desktop.
// Get elements
// jQuery
var myDivs = $('.my-div'); // Get all divs
const myDiv = document.querySelector('.myDiv'); // Get first div
const myDivs = document.querySelectorAll('.myDiv'); // Get all divs// How to handle click events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment