将多行文本框的内容在弹出窗口中输出,为什么实现不了啊?
谢谢指点!!<html>
<head>
<title>多行文本输入框textarea</title>
<script language="javascript">
<!--
function check()
{var text=document.frm.textarea_info.value;
var win=open("","mywin",menubar=no,width=200,height=70,resizable=yes");
win.document.writeln(text);
}//-->
</script>
<body>
<form name="frm">
<textarea name="texearea_info" cols="20" rows="3"></textarea>
<input type="button" value="查看结果" onclick="check()">
<input type="reset" value="重置">
</form>
</body>
</html>[/b]
谢谢指点!!<html>
<head>
<title>多行文本输入框textarea</title>
<script language="javascript">
<!--
function check()
{var text=document.frm.textarea_info.value;
var win=open("","mywin",menubar=no,width=200,height=70,resizable=yes");
win.document.writeln(text);
}//-->
</script>
<body>
<form name="frm">
<textarea name="texearea_info" cols="20" rows="3"></textarea>
<input type="button" value="查看结果" onclick="check()">
<input type="reset" value="重置">
</form>
</body>
</html>[/b]
<html>
<head>
<title>多行文本输入框textarea </title>
<script language="javascript">
function check()
{
var text=document.getElementsByName("texearea_info")[0].value;
var win=open("","mywin",menubar='no',width=200,height=70,resizable="yes");
win.document.writeln(text);
}
</script>
<body>
<form name="frm">
<textarea name="texearea_info" cols="20" rows="3"> </textarea>
<input type="button" value="查看结果" onclick="check()">
<input type="reset" value="重置">
</form>
</body>
</html>
var win=open("","mywin","menubar=no,width=200,height=70,resizable=yes");
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
function check(){
//var text=document.frm.textarea_info.value;
var text1 = document.getElementsByName("texearea_info")[0].value;
alert(text1)
var win=open("","mywin",menubar=no,width=200,height=70,resizable="yes");
win.document.writeln(text1);
}
</script>
</head><body>
<form name="frm">
<textarea name="texearea_info" cols="20" rows="3"> </textarea>
<input type="button" value="查看结果" onclick="check()">
<input type="reset" value="重置">
</form>
</body>
</html>
<html>
<head>
<title>多行文本输入框textarea </title>
<body>
<form name="frm">
<textarea id="content" name="texearea_info" cols="20" rows="3"> </textarea>
<input id="wp" type="button" value="查看结果">
<input type="reset" value="重置">
</form>
<SCRIPT LANGUAGE="JavaScript">
<!--
var $=function(o){return document.getElementById(o)};
$("wp").onclick=function(){
var win=open("","mywin","menubar=no,width=200,height=70,resizable=yes");
win.document.writeln($("content").value);
};
//-->
</SCRIPT>
</body>
</html>
<head>
<title>多行文本输入框textarea </title>
<script language="javascript">
<!--
function check(){
var txt=document.getElementById("texearea_info").value;
var cfg="menubar=no,width=500,height=300,resizable=yes"
var win=window.open("about:blank","__POPWIN__VIEW",cfg);
win.document.writeln("<pre>"+txt+"<pre>");
}//-->
</script>
<body>
<form id="frm" name="frm">
<textarea id="texearea_info" name="texearea_info" cols="20" rows="3"></textarea>
<input type="button" value="查看结果" onclick="check()">
<input type="reset" value="重置">
</form>
</body>
</html>
1、html里的文本框叫texearea_info,脚本里取的却是textarea_info;
2、open()里的第三个参数前面少了引号。