首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

点击按钮弹出框框,输入数据后回埋

2013-12-20 
点击按钮弹出框框,输入数据后回填。现在需要一个js,点击页面上的按钮,弹出一个大框框,然后往里面复制数据,

点击按钮弹出框框,输入数据后回填。
现在需要一个js,点击页面上的按钮,弹出一个大框框,然后往里面复制数据,填好之后回填到输入框,然后再进行查询。
点击按钮弹出框框,输入数据后回埋
里面的数据是由空格和换行来判断就是一条数据:
点击按钮弹出框框,输入数据后回埋
然后将所有数据回填进入输入框:
WL1001,WL1004,WL100333,WL1002,WL1003,WL1003,WL1003,WL10088
点击按钮弹出框框,输入数据后回埋
[解决办法]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function ss(){
var textarea=document.createElement("textarea");
var div=document.createElement("div");
var button=document.createElement("input");
button.type='button';
button.value='X';
button.onclick=function(){
document.getElementById("show").value=textarea.value;
document.body.removeChild(button);
document.body.removeChild(textarea);
document.body.removeChild(div);
}
setStyle(div,{
'position':'absolute',
'left':0,
'top':0,
'bottom':0,
'right':0,
'backgroundColor':'black',
'opacity':.5,
'filter':'alpha(opacity=50)'
});
setStyle(button,{
'position':'absolute',
'right':'0px',
'top':'0px'
})
setStyle(textarea,{
'position':'absolute',
'left':'100px',
'top':'100px'
})
document.body.appendChild(div);
document.body.appendChild(textarea);
document.body.appendChild(button);
}
function setStyle(dom,style){
for(var i in style){
if(style.hasOwnProperty(i)){
dom.style[i]=style[i];
}
}
}
</script>
</head>

<body>
<input type="text" id="show" />
<input type="button" value="查询" onclick="ss()">
</body>
</html>
类似这样试试 不是很明白你的意思

热点排行