What this code does is create a paragraph with whatever the value of #paragraph is which is a textarea tag and it works perfectly fine.
$('#insert_paragraph').click(function(){
var text = $('#paragraph').val();
$('#container').append('<p>'+text+'</p>');
});
And this code simply adds a class to whatever p tag was clicked on, however it only adds this class to the p elements that were created the first time the page was rendered and not the p elements created with the code above.
$('p').click(function(){
$(this).addClass('box');
});