سلام
امیدوارم این کد کمکتون کنه
موفق باشید
<html>
<head>
<script type="text/javascript">
function displayResult()
{
document.getElementById("myTextarea").select();
}
</script>
</head>
<body>
<textarea id="myTextarea" cols="20">
At W3Schools you will find all the Web-building tutorials you need, from basic HTML to advanced XML, SQL, ASP, and PHP.
</textarea>
<br />
<button type="button" onclick="displayResult()">انتخاب متن</button>
</body>
</html>