I have attempted to implement the following code, but unfortunately, it is not functioning as expected. I am hopeful that someone can assist me. I am seeking a way for the div tag to dynamically increase its height based on the size of the text. Does anyone have a solution for adding text to a div tag? In this case, jQuery is being utilized within the script tag.
$(function() {
$('#new').on('click', function() {
$('<p>Text</p>').appendTo('#Content');
});
});
#Content {
height: 770px;
width: 70%;
background-color: white;
border: 7px solid gray;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="button" id="new" value="Add Text">Addvalues</button>
<div id="Content"></div>