Skip to content

Instantly share code, notes, and snippets.

@redrambles
Created March 10, 2018 16:03
Show Gist options
  • Save redrambles/c01998a9e1404e7da9307158eda49a15 to your computer and use it in GitHub Desktop.
Save redrambles/c01998a9e1404e7da9307158eda49a15 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/yiquben
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<title>JS Bin</title>
</head>
<body>
<button id="lolcatButton">Show me the LOLCat!</button>
<br><br>
<img id="lolcatImage" src="">
<script id="jsbin-javascript">
$(document).ready(function() {
var lolcatImage = document.getElementById("lolcatImage");
var image = "https://s3.amazonaws.com/media.skillcrush.com/skillcrush/wp-content/uploads/2016/08/napTime.jpg";
/*var lolcatButton = document.getElementById("lolcatButton");*/
var showMeTheLolcat = function(){
lolcatImage.src = image;
};
/*lolcatButton.addEventListener("click", showMeTheLolcat);*/
$("#lolcatButton").click(lolcatImage);
});
</script>
<script id="jsbin-source-javascript" type="text/javascript">$(document).ready(function() {
var lolcatImage = document.getElementById("lolcatImage");
var image = "https://s3.amazonaws.com/media.skillcrush.com/skillcrush/wp-content/uploads/2016/08/napTime.jpg";
/*var lolcatButton = document.getElementById("lolcatButton");*/
var showMeTheLolcat = function(){
lolcatImage.src = image;
};
/*lolcatButton.addEventListener("click", showMeTheLolcat);*/
$("#lolcatButton").click(lolcatImage);
});</script></body>
</html>
$(document).ready(function() {
var lolcatImage = document.getElementById("lolcatImage");
var image = "https://s3.amazonaws.com/media.skillcrush.com/skillcrush/wp-content/uploads/2016/08/napTime.jpg";
/*var lolcatButton = document.getElementById("lolcatButton");*/
var showMeTheLolcat = function(){
lolcatImage.src = image;
};
/*lolcatButton.addEventListener("click", showMeTheLolcat);*/
$("#lolcatButton").click(lolcatImage);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment