Although this is what you said you tried, this worked for me in Firefox and IE:
Code: Select all
<html>
<head>
<script language="javascript" type="text/javascript">
function blabla()
{
var elem = document.getElementById('blatext').value = "This is bla";
}
</script>
</head>
<body>
<form>
<input type="button" value="bla" onClick="blabla()">
<textarea id="blatext"></textarea>
</form>
</body>
</html>
Besides changing the function to getElementById and changing the textarea attribute from name to id, I also removed the ";" from the event hookup in the button tag.
EDIT: Although W3C lists getElementByName is supported in all major browsers, I was getting a "getElementByName is not a function" error in the Firefox error console, so I don't know what the problem is there. However, I mostly use jQuery for Javascript so I don't have to sweat all of those details. You should check it out!