Is there a way for me to add another comment below the printed value, similar to Facebook comments? I want the reply option to appear under the displayed value after submitting, and when I click on reply, another input box should show up so that I can comment again on that specific value just like on Facebook. Also, I would like the input value to clear after submitting.
Can someone help me with this issue?
$(document).ready(function(){
$("#btn").click(function(){
let getVal = $("#inputValue").val();
let img = `<img src="https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80" class="rounded-circle" height="30px" width="30px">`
$("#output").html($("#output").html() + " " + img + getVal + `<br>` );
});
});
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<div id="main">
<div id="output"></div>
<input id="inputValue" type="text" name="text">
<button id="btn" class="btn btn-primary">display value</button>
</div>