J
Jennifer Palonus
I'm getting weird behavior in Firefox 2.0.0.9 when I try to query the
textContent of a textarea.
In this example, when I hit the [Test] button, the alert should show
me the text that's currently in the textarea. IE does this fine, but
Firefox always shows me the initial text, even if I type something
else into the textarea.
============================
<script>
if (window.createPopup)
{g_sBrowserType = "IE";
}
else
{g_sBrowserType = "Mozilla";
}
function onClickTest ()
{
var oEditor = document.getElementById("taEditor");
var sText = g_sBrowserType=="IE" ? oEditor.innerText :
oEditor.textContent;
alert (sText);
}
</script>
<b>Source text</b><br>
<form name="frmTest">
<textarea id="taEditor" cols="80" rows="20">My initial text</textarea>
<p><button type="button" onclick="onClickTest()">Test</button>
============================
Graphical Dynamics, Inc
http://www.graphicaldynamics.com
textContent of a textarea.
In this example, when I hit the [Test] button, the alert should show
me the text that's currently in the textarea. IE does this fine, but
Firefox always shows me the initial text, even if I type something
else into the textarea.
============================
<script>
if (window.createPopup)
{g_sBrowserType = "IE";
}
else
{g_sBrowserType = "Mozilla";
}
function onClickTest ()
{
var oEditor = document.getElementById("taEditor");
var sText = g_sBrowserType=="IE" ? oEditor.innerText :
oEditor.textContent;
alert (sText);
}
</script>
<b>Source text</b><br>
<form name="frmTest">
<textarea id="taEditor" cols="80" rows="20">My initial text</textarea>
<p><button type="button" onclick="onClickTest()">Test</button>
============================
Graphical Dynamics, Inc
http://www.graphicaldynamics.com