【问题标题】:Why element attribute change jQuery works on Firefox not on Chrome为什么元素属性更改jQuery适用于Firefox而不是Chrome
【发布时间】:2018-11-30 13:17:44
【问题描述】:

我有这个 jQuery,它可以在选择文件时更改占位符的名称。此代码适用于 Mozilla Firefox,但不适用于 Chrome。知道为什么吗?

$(".browswfile input").change(function(){
    $file = this.value;
    $file = $file.replace(/.*[\/\\]/, '');
    $("#uploadFile").attr("placeholder",$file);
});

此外,我正在使用这个版本的 jquery API:https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js 请帮忙!谢谢!

【问题讨论】:

    标签: javascript jquery google-chrome firefox


    【解决方案1】:

    我找到了答案:清除缓存。这对我有用,以防万一有人面临同样的问题。

    【讨论】:

      猜你喜欢
      • 2015-05-05
      • 2020-12-10
      • 2010-12-31
      • 2011-02-10
      • 2015-06-13
      • 1970-01-01
      • 2011-08-21
      • 1970-01-01
      • 2018-06-30
      相关资源
      最近更新 更多