Advertisement
inqw

Untitled

Jul 18th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //define functions here
  2.  
  3. function getIt() {
  4.   let thing = $('p')[0];
  5.   $(thing).on('click', function() {
  6.     alert('Hey!')
  7.   })
  8. }
  9. function frameIt() {
  10.   let thing = $('img')[0];
  11.   $(thing).on('click', function() {
  12.     $(this).addClass('tasty')
  13.   })
  14. }
  15.  
  16. function pressIt() {
  17.   let thing = $('#typing')[0];
  18.   $(thing).on('keydown', function(key) {
  19.     if (key.which == 71) {
  20.       alert("You pressed G!")
  21.     }
  22.   })
  23. }
  24.  
  25. function submitIt() {
  26.   let thing = $('form')[0];
  27.   $(thing).on('submit', function() {
  28.     alert("Your form is going to be submitted now.")
  29.   })
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement