The following will highlight the text within a textarea upon clicking into the box.
<!-- jQuery is required. Remove the following line if you already are referencing jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<textarea id="txtOutput" style="width: 500px; height: 300px; ">@this.Model.Output</textarea>
<script type="text/javascript">
$("#txtOutput").focus(function()
{
var $this = $(this);
$this.select();
// Work around Chrome's little problem
$this.mouseup(function ()
{
// Prevent further mouseup intervention
$this.unbind("mouseup");
return false;
});
});
</script>