Skip to content

Instantly share code, notes, and snippets.

@plusjade
Created September 30, 2014 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plusjade/9d5c750b9acccbb2f780 to your computer and use it in GitHub Desktop.
Save plusjade/9d5c750b9acccbb2f780 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<style>
h1 { color: red; }
</style>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'></script>
</head>
<body>
<h1>My site</h1>
<input name="jade" value="5"/>
<button id="myBtn">Update</button>
<h2>Hello</h2>
<script>
$( "#myBtn" ).click( function() {
console.log( "I have been clicked!!!!" );
run();
doSomethingElse();
});
function run() {
var number = $('input').val();
console.log(number);
// number converter
var farenheit = (number * 1.8) + 32;
console.log(farenheit);
$('h1').html(farenheit)
}
function doSomethingElse() {
// some complicated code
console.log('complicated code')
}
run();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment