HTML
<!DOCTYPE html>
<html>
<head>
<title>DOM Access</title>
<script type="text/javascript">// <![CDATA[
function valideraData() {
var textvarde = document.getElementById("text01").value;
if (textvarde != '') {
alert("Du skrev: " + textvarde);
} else {
alert("Du måste skriva något!");
}
}
// ]]></script>
<body>
<form name="form">
<textarea name="text" id="text01" style="width:55em,height:12em;"></textarea>
<input type="button" value="Skicka Data" onclick="valideraData()" />
</form>
</body>
</html>