<html> <head> <script language="JavaScript"> function function1() { alert(myTextArea.value); } </script> </head> <body onload="function1();"> <textarea id="myTextArea">textarea value</textarea> </body> </html>