I hereby claim:
- I am kidmillions on github.
- I am kidmillions (https://keybase.io/kidmillions) on keybase.
- I have a public key ASDuzto9jtrh25Cq3bFDiu89Uw0HKl9jyiFE-7nAJ4-aAwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
//write a function that | |
var showImage = function() { | |
var imageSource = $(this).attr('data-imagesource'); | |
var image = $('img'); | |
image.attr('src', imageSource); | |
} | |
//gets the data-topic attr | |
//if data-topc attr is 'money' | |
//select the image and change it's src to money |
var something = function(n) { | |
return doSomethingElse(n) * 2; | |
} | |
var doSomethingElse = function(m) { | |
return m * 2; | |
} | |
var x = something(5); | |
var y = something(100); |
var link = document.querySelector('.special-link'); | |
var numOfClicks = 1; | |
// javascript event listener using function variable as callback | |
var func = function() { | |
//append the message I've been clicked n times |
var numOfClicks = 1; | |
//jquery click listener using an anonymous function | |
$('.special-link').click(function() { | |
//append the message I've been clicked n times | |
$('#box').append('I\'ve been clicked ' + numOfClicks + ' times!'); | |
//increment a number representing number of clicks | |
numOfClicks++; | |
}); |
//create a function that says hello to a politician | |
//function takes in a name | |
//appends into the box a greeting to that name | |
var sayHello = function(event) { | |
var poliName = $(event.target).text(); | |
$('#box').html('<h2>Hello, Mr. ' + poliName + '!</h2>' ) | |
} | |
var sum = function(x, y) { | |
return x + y; | |
}; | |
sum(3, 2); | |
var doubler = function(number) { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
</head> | |
<body> | |
<div id="target"> | |
</div> | |
<script> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
</head> | |
<body> | |
<div id="target"> | |
</div> | |
<script> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<style> | |
.odd { | |
color: magenta; | |
} | |
.even { |