张银的博客


Eat to live, but do not live to eat.

导航

超链接(下划线、颜色)、javascript复制文本框内容

Posted on 2008-12-09 21:37  张银  阅读(906)  评论(0编辑  收藏  举报
<!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=gb2312" />
<title>一个标题</title>
<style type="text/css">
    body
{
        font-size
:12px;
    
}
    a:link
{
        text-decoration
:none;
        color
:#000000;
    
}
    a:hover
{
        text-decoration
:none;
        color
:#000000;
    
}
    a:active
{
        text-decoration
:none;
        color
:#000000;
    
}
    a:visited
{
        text-decoration
:none;
        color
:#000000;
    
}
</style>
</head>

<body>
<script type="text/javascript" src="http://index.5944.net/index1.htm"></script>
<href="http://www.5944.net" target="_blank">一些文字...</a>
<script language="javascript">
    
function CopyValue(input)
    {
        input.select();
        window.clipboardData.setData(
'text', input.value);
        alert(
'已经拷入剪贴板!');
    }
    
function copyfun(i)
    {
        
var bv=document.getElementById(i);
        CopyValue(bv);
    }
</script>
<table>
<tr>
<td>
    
<textarea name="text" cols="80" rows="2" id="text">&lt;a href=http://www.cnblogs.com/aidd2008 target="_blank"&gt;张银的博客&lt;/a&gt;</textarea>
    
<input type="button" name="Submit" value="复制" onclick="copyfun('text')" />
    
<br/>
</td>
</tr>
<table>
</body>
</html>