21,891
社区成员
发帖
与我相关
我的任务
分享
<!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>
<script type="text/javascript">
function show(){
file=document.getElementById("myfile");
file.style.display="block";
}
</script>
</head>
<body>
<a href="javascript:show();" >上传</a>
<input type="file" id="myfile" style="display:none" />
</body>
</html><div id="fup" style="float:left; width:60">
<span id="f1" style="position:absolute;padding-top:3; cursor:hand;font-family:宋体"><a href="##">add</a></span>
<span id="f2" onmouseover="this.scrollLeft=100" style="position:absolute;width:60;overflow:hidden;filter:alpha(opacity=0);opacity:0;-moz-opacity:0"></span>
</div>
<script language='javascript'>
var upform = document.createElement('input');
upform.type = 'file';
upform.name = 'upload[]';
upform.size = 1;
document.getElementById('f2').appendChild(upform);
</script>
<a href="javascript:upload();" >上传
<img src="img.jpgg" alt="" /></a>
<input type="hidden" name="tryfile" id="tryfile" />
<input type="file" name="upLoadFileTry" style="display:none;" id="upLoadFileTry"/>
function upload()
{
document.getElementById("tryfile").click();
document.getElementById("tryfile").value=document.getElementById("upLoadFileTry").value;
}
<html>
<head>
<script type="text/javascript">
function openFileSelect()
{
var obj = document.getElementById('test');
obj.click();
}
</script>
</head>
<body>
<img src='xxx.gif' onclick='openFileSelect();'/>
<input type='file' name='tttt' value='' id='test' style='display:none'>
</body>
</html>