Skip to content

Instantly share code, notes, and snippets.

@seppenen
Last active February 18, 2018 22:12
Show Gist options
  • Save seppenen/19d0311a605da8c77df770d578e45e90 to your computer and use it in GitHub Desktop.
Save seppenen/19d0311a605da8c77df770d578e45e90 to your computer and use it in GitHub Desktop.
jquery insert to div from input
$(document).ready(function() {
$(document).on('click', '#add_comment', function() {
$("form[name='form']").css("display", "block");
$("#add_comment").hide();
});
$("#done").on("click", function() {
var form = $("#textarea").val();
$("#comments").append("<p>"+form+"</p>");
$("#textarea").val("");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment