Last active
February 18, 2018 22:12
-
-
Save seppenen/19d0311a605da8c77df770d578e45e90 to your computer and use it in GitHub Desktop.
jquery insert to div from input
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
$(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