Created
March 9, 2017 04:43
-
-
Save kyleturman/a395633f0dc2cc90526f084cc6141767 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=a395633f0dc2cc90526f084cc6141767
This file contains hidden or 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> | |
<title>Page Title</title> | |
</head> | |
<body> | |
<div class="hero"> | |
<h1>Hello again!</h1> | |
</div> | |
<p>Welcome to my website! Enter your name below and click the button to say hello. But there's also a bug in the javascript! See if you can find it.</p> | |
<input id='name' type='input' placeholder="Enter your name" /> | |
<button id='button'>Click to say hello</button> | |
</body> | |
</html> |
This file contains hidden or 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
{"enabledLibraries":["jquery"]} |
This file contains hidden or 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
// There's a bug here somewhere, where is it? | |
function sayHello(name) { | |
alert("Hello, " + name + "!"); | |
} | |
$(document).ready(function(){ | |
$('#button').on('click', function(){ | |
var nameValue = $("#name").val(); | |
sayHello(); | |
}); | |
}); |
This file contains hidden or 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
body { | |
text-align: center; | |
margin: 0; | |
} | |
.hero { | |
background-color: blue; | |
color: white; | |
height: 300px; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment