Capture o valor da textarea

<textarea id="myTextarea">
Hello World
</textarea>

<script>
  var x = document.getElementById("myTextarea").value;
</script>
Saf1