If you are using the JavaScript jQuery library then it will be very easy to display value while typing in the text box. You can do it using the jQuery keyup() method. I also use this keyup() method to get values while typing in the textbox or textarea. You will need to create an HTML text box or you can create a textarea. Give an id name like - id="content" . You will need a jQuery CDN link. Use the jQuery ready() method and keyup() method using the textbox id.
Create an example -
<!DOCTYPE html>
<html>
<head>
<title>Getting value from the HTML text box while typing in jQuery</title>
</head>
<script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#content").keyup(function(){
var content=$("#content").val();
$("#display_content").html(content);
});
});
</script>
<body>
<p id="display_content"></p>
<form>
<input type="text" name="content" id="content" placeholder="Typing">
</form>
</body>
</html>
You can display content id using the html() method while typing. In this way, you can display text on the page while typing in the textbox or textarea in jQuery.