html里如何获取file的绝对路径
展开全部
<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>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询