设置上传文件的路径

时间:2014-09-08 11:15:14

标签: javascript

我是js的新手,我有这样的代码,它将设置上传文件的路径:

document.getElementById("binaryFilePath").value = "location"

当我跑步时,我得到:

[Error] InvalidStateError: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.
    global code (AppAdmin, line 1)

发生了什么事?

1 个答案:

答案 0 :(得分:-1)

你在找这个吗?

  function myFunction()
  {
  var x = document.getElementById("myFile").type;
  document.getElementById("demo").innerHTML = x;
  }

使用小提琴网址:http://jsfiddle.net/huboxpc8/