Skip to content

Instantly share code, notes, and snippets.

@cmoscardi
Created February 27, 2017 01:57
Show Gist options
  • Save cmoscardi/e640d4a3e3e2bee7642a95ae9d4095cf to your computer and use it in GitHub Desktop.
Save cmoscardi/e640d4a3e3e2bee7642a95ae9d4095cf to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=e640d4a3e3e2bee7642a95ae9d4095cf
<!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>
{"enabledLibraries":["jquery"]}
$('#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);
});
.info {
border: 1px solid black;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment