New to coding, sharing my code here:
<html>
<head>
<script type="text/javascript">
function replyOne () {
document.getElementById("comment_content").value = document.getElementById("username")
}
</script>
</head>
<body>
<p id="username">Jack</p>
<textarea id="comment_content" ></textarea>
<button onclick="replyOne()">Copy Text</button>
</body>
</html>
When I press the button, I anticipate 'Jack' will be copied to the textarea. However, it merely displays '[object HTMLParagraphElement]'.