Last active
April 30, 2016 20:56
-
-
Save tmcw/5961916 to your computer and use it in GitHub Desktop.
Minimal Code+Demo Setup for bl.ocks.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="https://yandex.st/highlightjs/7.3/styles/default.min.css"> | |
<script src="https://yandex.st/highlightjs/7.3/highlight.min.js"></script> | |
<script src="https://code.jquery.com/jquery-1.10.1.min.js"></script> | |
<style> | |
body, pre { | |
margin:0; padding:0; font:normal 12px/20px sans-serif; | |
} | |
.left { | |
background:#ccc; | |
text-align:center; | |
} | |
.left, .right { | |
width:50%; | |
float:left; | |
} | |
.pad { | |
padding:10px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class='left'> | |
<div class='pad'> | |
<button id='button'>add a number</button> | |
<h2 id='count'>0</h2> | |
</div> | |
</div> | |
<div class='right'> | |
<pre><code id='code' class='javascript'>var myNum = 0; | |
$('#button').click(function() { | |
$('#count').text(++myNum); | |
}); | |
</code></pre> | |
</div> | |
<script type='text/javascript'> | |
eval($('#code').text()); | |
hljs.initHighlightingOnLoad(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment