Skip to content

Instantly share code, notes, and snippets.

Created June 5, 2015 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/05ad062dd7cf240f903d to your computer and use it in GitHub Desktop.
Save anonymous/05ad062dd7cf240f903d to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/demisaxixu
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<button onclick="random()">click</button>
<p id="aantal">ll</p>
<script>
</script>
<script id="jsbin-javascript">
var cursos = ["lala", "lele", "lili", "okok", "yyy"];
var max = cursos.length;
function random(){
var rnd = Math.floor(Math.random() * max);
document.getElementById("aantal").innerHTML = cursos[rnd];
}
</script>
<script id="jsbin-source-javascript" type="text/javascript"> var cursos = ["lala", "lele", "lili", "okok", "yyy"];
var max = cursos.length;
function random(){
var rnd = Math.floor(Math.random() * max);
document.getElementById("aantal").innerHTML = cursos[rnd];
}</script></body>
</html>
var cursos = ["lala", "lele", "lili", "okok", "yyy"];
var max = cursos.length;
function random(){
var rnd = Math.floor(Math.random() * max);
document.getElementById("aantal").innerHTML = cursos[rnd];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment