3
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by Dani
0

Unless I'm mistaken (and could be, since I haven't javascripted in a while), doesn't it matter which browser you are doing it for? (like, aren't the DOM's different for IE and mozilla?)

I think the w3c compliant version is:

document.getElementById('textboxnamehere').value="text to display";
0

Comatose is correct. Here is more detail.

<script type="text/javascript">
function ElementContent(id,content)
{
    document.getElementById(id).value = content;
}
</script>

<textarea id="ta1">&nbsp;</textarea>
<button value="Click Me!" onclick="ElementContent('ta1','Hey, it works.')" />
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.