如何修复重命名的输入“文件”浏览按钮不能在IE上工作?

时间:2014-10-06 06:21:10

标签: javascript jquery html css

我使用此代码重命名输入类型文件浏览按钮,该代码适用于Firefox和Chrome,但它不适用于IE 8 +,有人可以帮我修复此问题或请给我一个替代方法,谢谢

HTML

    <input type="button" class="red" id="pseudobutton" value="Attach Photo"/>
    <input type="file" name="attachement" class="hide" id="openssme" onmousedown="buttonPush('depressed');" onmouseup="buttonPush('normal');" onmouseout="buttonPush('phased');"/>

CSS

   input.hide
    {
          position:absolute;
          left:370px;
          -moz-opacity:0;
          filter:alpha(opacity: 0);
          opacity: 0;
          z-index: 2;
    }

JS

<script type="text/javascript">
function buttonPush (buttonStatus)
  {
  if (buttonStatus == "depressed")
        document.getElementById("pseudobutton").style.borderStyle = "inset";
  else
        document.getElementById("pseudobutton").style.borderStyle = "outset";
  }
</script>

0 个答案:

没有答案