属性='值'jquery选择没有'我不在IE工作

attribute!='value' jquery selection doesn't work in IE

本文关键字:IE 工作 选择 jquery 属性      更新时间:2023-12-06

我有一个jQuery( "[attribute!='value']" ) jquery选择,它适用于除IE之外的所有浏览器。我也尝试过.not( "[name='value']" ),但没有成功。

JS:

$("input[type=file]").not("[name='photo_1']").parents('.fileinput-wrapper').find(".label").remove();

我该怎么办?

编辑:

$("input[name!='photo_1']").parents('.fileinput-wrapper').find(".label").remove();

我认为.filter可能是这里的答案:

$("input[type='file']").filter(function(){
    if($(this).attr('name') != 'photo_1'){
        return true;
    }
    return false;
}).parents('.fileinput-wrapper').find(".label").remove();