<!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>
类似这样试试 不是很明白你的意思