<script>
window.onload=function(){
var val = window.opener.document.form1.LastUnid.value;
document.form1.txt.value = val;
}</script>
<body>
<form name="form1">
<input type="text" name="txt">
</form>
</body>
window.onload=function(){
var val = window.opener.document.form1.LastUnid.value;
document.form1.txt.value = val;
}</script>
<body>
<form name="form1">
<input type="text" name="txt">
</form>
</body>
也可以个元素赋予id然后用getElementById(id)来实现.
window.onload=function(){
var val = window.opener.document.form1.LastUnid.value;
var ele = document.getElementById("myTxt");
ele.value = val;
}
</script>
<body>
<form name="form1">
<input id="myTxt" type="text" name="txt">
</form>
</body>
这个我估计你在FF下不兼容。
尽量使用兼容的写