Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //define functions here
- function getIt() {
- let thing = $('p')[0];
- $(thing).on('click', function() {
- alert('Hey!')
- })
- }
- function frameIt() {
- let thing = $('img')[0];
- $(thing).on('click', function() {
- $(this).addClass('tasty')
- })
- }
- function pressIt() {
- let thing = $('#typing')[0];
- $(thing).on('keydown', function(key) {
- if (key.which == 71) {
- alert("You pressed G!")
- }
- })
- }
- function submitIt() {
- let thing = $('form')[0];
- $(thing).on('submit', function() {
- alert("Your form is going to be submitted now.")
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement