javascript如何将信息在一个可以复制的对话框中弹出?

来源:百度知道 编辑:UC知道 时间:2024/05/07 16:49:21
例如要弹出信息
alert("hello, word");
但是天出的框不能用鼠标将信息复制,如果弹出的数据量很大,就不得不手动记下。
有没有别的弹出框可以让用户可以复制弹出的信息的?

使用自写的弹出窗口就好了:(将下列代码添加到页面中,使用时调用myalert函数,例如:myalert('hello world!');)

function myalert(str) 

var shield = document.createElement("DIV"); 
shield.id = "shield"; 
shield.style.position = "absolute"; 
shield.style.left = "0px"; 
shield.style.top = "0px"; 
shield.style.width = "100%"; 
shield.style.height = document.body.scrollHeight+"px"; 
//弹出对话框时的背景颜色 
shield.style.background = "#fff"; 
shield.style.textAlign = "center"; 
shield.style.zIndex = "25"; 
//背景透明 IE有效 
//shield.style.filter = "alpha(opacity=0)"; 
var alertFram = document.createElement("DI