<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<span>上传图片</span>
<br>
<div><input type="file" id="upfile" sylt='display: none;'>
</div>
</body>
</html>当点击上传图片时显示FIL再点就使这隐藏,最好能写出代吗,谢谢
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<span>上传图片</span>
<br>
<div><input type="file" id="upfile" sylt='display: none;'>
</div>
</body>
</html>当点击上传图片时显示FIL再点就使这隐藏,最好能写出代吗,谢谢
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
function a(){
var a = document.getElementById("upfile");
a.style.display = (a.style.display==""?"none":"");
}
</script>
</head>
<body>
<span onclick="a()" style="cursor:hand">上传图片</span>
<br>
<div><input type="file" id="upfile" style='display: none;'>
</div>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<span>上传图片</span>
<span>上传文件</span>
<br>
<div><input type="file" id="upfile" sylt='display: none;'>
</div>
</body>
</html>当点击上传图片时显示FILE再点就使这隐藏,当点击上传文件时显示FILE再点就使这隐藏,但是当第一次点击上传图片时显示FILE,然后点击上传文件时会隐藏了FILE,这个问题应该怎么解决,最好能写出代吗,谢谢
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>无标题文档</title>
<script>
function a(obj){
var a = document.getElementById("upfile");
a.style.display = (obj.open?"":"none");
obj.open=!obj.open;
}
</script>
</head>
<body>
<span onclick="a(this)" style="cursor:hand" open="true">上传图片</span>
<br>
<span onclick="a(this)" style="cursor:hand" open="true">上传文件</span>
<br>
<div><input type="file" id="upfile" style='display: none;'>
</div>
</body>
</html>