如何获取标签里面的文件路径
若以下回答无法解决问题,邀请你更新回答
展开全部
<script>
function pageX(elem){
return elem.offsetParent?(elem.offsetLeft+pageX(elem.offsetParent)):elem.offsetLeft;
}
function setX(elem,pos){
elem.style.left=pos+"px";
}
function fclick(obj,elem){
var pos = pageX(elem);
setX(obj,pos);
}
function readFile(elem){
document.getElementById("mytext").value = elem.value;
}
</script>
<form enctype="multipart/form-data">
<input id="mytext" type="text" readonly="true"> <input type="button" onmouseover="fclick(t_file,this)" value="改">
<input name="upload" type="file" id="t_file" onchange="readFile(this)" style="position:absolute;filter:alpha(opacity=0);opacity:0;width:30;">
</form>
function pageX(elem){
return elem.offsetParent?(elem.offsetLeft+pageX(elem.offsetParent)):elem.offsetLeft;
}
function setX(elem,pos){
elem.style.left=pos+"px";
}
function fclick(obj,elem){
var pos = pageX(elem);
setX(obj,pos);
}
function readFile(elem){
document.getElementById("mytext").value = elem.value;
}
</script>
<form enctype="multipart/form-data">
<input id="mytext" type="text" readonly="true"> <input type="button" onmouseover="fclick(t_file,this)" value="改">
<input name="upload" type="file" id="t_file" onchange="readFile(this)" style="position:absolute;filter:alpha(opacity=0);opacity:0;width:30;">
</form>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询