Created
February 27, 2017 01:57
-
-
Save cmoscardi/e640d4a3e3e2bee7642a95ae9d4095cf to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=e640d4a3e3e2bee7642a95ae9d4095cf
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> | |
<title>Page Title</title> | |
</head> | |
<body> | |
<input placeholder="name" id="name" /> | |
<input placeholder="description" id="description" /> | |
<button id="describe-button">Add Item</button> | |
</body> | |
</html> |
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
{"enabledLibraries":["jquery"]} |
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
$('#describe-button').click(function() { | |
var name = $("#name").val(); | |
var description = $("#description").val(); | |
var infoBox = "<div class='info'> Name: " + name + | |
"<br /> Description: " + description + "</div>"; | |
$("body").append(infoBox); | |
}); | |
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
.info { | |
border: 1px solid black; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment