Skip to content

Instantly share code, notes, and snippets.

@mbuyco
Last active December 19, 2015 05:49
Show Gist options
  • Save mbuyco/5906531 to your computer and use it in GitHub Desktop.
Save mbuyco/5906531 to your computer and use it in GitHub Desktop.
This is how you append html codes using JQuery.
$(document).ready(function()
{
$("#append_form").submit(function() {
// The \n below is for new line in JavaScript
var append_texts = "<div>\n"+
$("#append_text_1").val() +" "+ $("#append_text_1").val() +"\n"+
"</div>";
$("#append_area").append(append_texts);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment