问,如何通过点击按纽弹出窗口输入数据,再赋值给文本框啊。 onclick="javascript:this.value=prompt('请输入值');" 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 onclick="javascript:this.value=prompt('请输入值');" 我是想弹出个新页面,用window.open,我就是不知道原页面的文本框如何定位?请继续指教。 opener.***document.createElementparentobject.appendChildparentobject.insertBeforeinnerHTML(上述IE5+,NN6+)insertAdjacentElement(据微软某文章说插入最快)insertAdjacentHTMLinsertAdjacentText(IE4+,element:IE5+) opener.document.all.??(IE)opener.document.getElementById("??") (DOM) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><title>无标题文档</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><script language="javascript">function addRow(src){ //alert(src); var newrow = src.insertRow(src.rows.length-1); newrow.height=20; var i=4; while(i--){ var newcell = newrow.insertCell(); switch(i){ case 0: newcell.innerHTML= '<input type="button" onClick="javascript:delRow(this.parentElement.parentElement)" value="删除此行">';break; default: newcell.innerHTML=div1.innerHTML;break; } }}function delRow(src){ var tab=src.parentElement; var i=tab.rows.length; while(i--){ if(src==tab.rows[i]){ alert("就是这行----"+ i); tab.deleteRow(i); } }}</script></head><body><table id="tb" width="100%" border="1" align="center" cellpadding="1" cellspacing="1" style="border-collapse:collapse" bordercolor="#111111"> <tr> <th scope="col" width="25%">奶类</th> <th scope="col" width="25%">数量</th> <th scope="col" width="25%">总重</th> <th scope="col" width="25%">单价</th> </tr> <tr id="blankRow" onClick="addRow(this.parentElement)"> <td> </td> <td> </td> <td> </td> <td> </td> </tr></table><div id="div1" style="display:none "><input id="txt" type="text" style="width:97%; background-color:#FFFFEF"></div></body></html>这样行不行 页面定位用window.move(横标,纵标)window.open('x.html","标题",width=宽读 ,height=高度) function aa(){window.move(横标,纵标) //页面定位用window.open('x.html","标题",width=宽读 ,height=高度)window.document.write("<table name='table11'>"+"<tr>"+"<td>"+"<from name='from1' action="" >"+<input type="text" name='text1'>"+<input type="text" name='text2'>"+"<input type="submit" name='submit1'>+"</from>"+"</td>"+"</tr>"+"</table>")} iframe刷新子页面 各位朋友,我们说javascript是不是好无奈,请看下面的例子,应当如何解释啊? 如何生成可以拖动的控件 span class 提问 为什么我的URL用document.URL显示出来的没有了querystring? 升级了,庆贺一下!散分 问showModalDialog的问题 一个javascript的问题。(关于frame的) 小白请教个变量赋值位置的问题 js数字怎么转化为正整数 比如150 转为100 190转为100 1462转为1400 数字的后两位直接转成00 求助:一个链接的问题 谁能告诉我parseInt("08")等于几
parentobject.appendChild
parentobject.insertBefore
innerHTML
(上述IE5+,NN6+)insertAdjacentElement(据微软某文章说插入最快)
insertAdjacentHTML
insertAdjacentText
(IE4+,element:IE5+)
opener.document.getElementById("??") (DOM)
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function addRow(src){
//alert(src);
var newrow = src.insertRow(src.rows.length-1);
newrow.height=20;
var i=4;
while(i--){
var newcell = newrow.insertCell();
switch(i){
case 0: newcell.innerHTML= '<input type="button" onClick="javascript:delRow(this.parentElement.parentElement)" value="删除此行">';break;
default: newcell.innerHTML=div1.innerHTML;break;
}
}
}
function delRow(src){
var tab=src.parentElement;
var i=tab.rows.length;
while(i--){
if(src==tab.rows[i]){
alert("就是这行----"+ i);
tab.deleteRow(i);
}
}
}
</script>
</head><body>
<table id="tb" width="100%" border="1" align="center" cellpadding="1" cellspacing="1" style="border-collapse:collapse" bordercolor="#111111">
<tr>
<th scope="col" width="25%">奶类</th>
<th scope="col" width="25%">数量</th>
<th scope="col" width="25%">总重</th>
<th scope="col" width="25%">单价</th>
</tr>
<tr id="blankRow" onClick="addRow(this.parentElement)">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<div id="div1" style="display:none "><input id="txt" type="text" style="width:97%; background-color:#FFFFEF"></div>
</body>
</html>
这样行不行
window.open('x.html","标题",width=宽读 ,height=高度)
window.move(横标,纵标) //页面定位用
window.open('x.html","标题",width=宽读 ,height=高度)
window.document.write("<table name='table11'>"+
"<tr>"+
"<td>"+
"<from name='from1' action="" >"+
<input type="text" name='text1'>"+
<input type="text" name='text2'>"+
"<input type="submit" name='submit1'>+
"</from>"+
"</td>"+
"</tr>"+
"</table>")
}