Skip to content

Instantly share code, notes, and snippets.

@sangpt
Created July 7, 2016 14:11
Show Gist options
  • Save sangpt/1dd809d1b6bbb2929a82deb8edac0718 to your computer and use it in GitHub Desktop.
Save sangpt/1dd809d1b6bbb2929a82deb8edac0718 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script>
var i = 0;
function myFunction() {
var arr = ["https://scontent-hkg3-1.xx.fbcdn.net/v/t1.0-9/13614963_575086482664798_8883246360922577859_n.jpg?oh=b32359dce459fc119f53ddc98aeb0285&oe=57EB408A","https://scontent-hkg3-1.xx.fbcdn.net/v/t1.0-9/13614970_640455629436155_6508876143278195466_n.jpg?oh=feb612e4c3ff5a4a96b1f4483fc915e8&oe=582BAC5A"];
document.getElementById("myImage").src=arr[i];
i+=1;
}
</script>
</head>
<body>
<img id="myImage" src="https://scontent-hkg3-1.xx.fbcdn.net/v/t1.0-9/13615125_1603588606356260_1357604661649486581_n.jpg?oh=7c403e1349ced0ab8fb4754b42f87093&oe=57E95B42" style="width:100px">
</br>
<button onclick="myFunction()">Next Image</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment