Skip to content

Instantly share code, notes, and snippets.

@v2keener
Created December 7, 2017 21:49
Show Gist options
  • Select an option

  • Save v2keener/1b97c92e76c0f1bcd06afa600b17e1dc to your computer and use it in GitHub Desktop.

Select an option

Save v2keener/1b97c92e76c0f1bcd06afa600b17e1dc to your computer and use it in GitHub Desktop.
Simple Bit // source http://jsbin.com/cexolon
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Simple Bit</title>
</head>
<body>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<div id="a"></div>
<script id="jsbin-javascript">
var rand = Math.random();
$('#a').html("The answer to whatever you asked"
+ " is: "
+ (rand >= 0.5 ? "Yes" : "No")
+ " ("
+ rand.toString().substring(0, 5)
+ ")");
</script>
<script id="jsbin-source-javascript" type="text/javascript">var rand = Math.random();
$('#a').html("The answer to whatever you asked"
+ " is: "
+ (rand >= 0.5 ? "Yes" : "No")
+ " ("
+ rand.toString().substring(0, 5)
+ ")");</script></body>
</html>
var rand = Math.random();
$('#a').html("The answer to whatever you asked"
+ " is: "
+ (rand >= 0.5 ? "Yes" : "No")
+ " ("
+ rand.toString().substring(0, 5)
+ ")");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment