谁有空帮忙看看啊,我这里用innerText只能在IE里面得到textarea里面的值。火狐上不行啊。在火狐上怎么弄?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT=""><script language="javascript">function fun(){
alert(document.getElementById("area").innerText);}
</script>
</HEAD>
<BODY>
<form id="aa"> <textarea name="area" id="area" style="width:191px;height:40px;margin:0px 10px 0px 17px">111</textarea> <input type="button" value="确定" onclick="fun()">
</form>
</BODY>
</HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT=""><script language="javascript">function fun(){
alert(document.getElementById("area").innerText);}
</script>
</HEAD>
<BODY>
<form id="aa"> <textarea name="area" id="area" style="width:191px;height:40px;margin:0px 10px 0px 17px">111</textarea> <input type="button" value="确定" onclick="fun()">
</form>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT=""><script language="javascript">function fun(param){
alert(param.parentNode.childNodes[0].innerText);}
</script>
</HEAD>
<BODY>
<div id="aa"> <textarea name="area" id="area" style="width:191px;height:40px;margin:0px 10px 0px 17px">111</textarea> <input type="button" value="确定" onclick="fun(this)">
</div>
</BODY>
</HTML>