I have a text area. The value of this text area is to keep updating using a loop. What I want is to select any portion of the text area and copy the selected text. But I cannot select the text since the textarea is keep updating. Please see the sample code below.
<html lang="en">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
var x = 0;
setInterval(function () {
$('#txtData').append('Test value ' + x++ + '\n');
}, 100);
});
</script>
</head>
<body>
<div>
<textarea id="txtData" style="width:200px;height:200px;overflow: auto;"></textarea>
</div>
</body>
</html>
As in the above image. I want to select the text.
Can someone please help me with this issue.
') and that should give you the same look but you'll be able to select while the loop keeps appending. – Doug F Oct 02 '19 at 16:09