Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<<!DOCTYPE html>
<html>
<head>
<title>Test Your Luck Here!</title>
<script type="text/javascript">
function myFunction() {
var x = Math.floor((Math.random() * 6) +1);
document.getElementById("value1").innerHTML = x;
}
</script>
</head>
<body>
<h1>Test Your Luck Here!</h1>
<p id="value1"></p>
<button onclick="myFunction()">Roll!</button>
</body>
</html>
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
jsbeginnerpro
0viewers