我将如何为此语句添加另一个不等于(!=)的值?我将如何添加另一个不等于(!=)这个陈述?
if ($(this).data("increase_priority1") && $(this).val() != 1)
我试图反转在其确定其是否等于所述函数的开头的语法,但是从完全除去物品(包括那些不等于1)停止它
if ($(this).data("increase_priority1") && $(this).val() != 1 && $(".complaint select").val() != "Too_small")
该函数添加和/或在用户选择投诉并将问题的重要性级别进行排名时从“increase_priority1”中删除值,并且我需要它来更改该值(在这种情况下投诉是什么)和重要性级别(即increase_priority1)如果这两个字段中的任何一个发生变化目前只有在重要性水平发生变化时才会发生变化。
完整的功能是:
var $increase_priority1 = $(".increase_priority1");
$('.ranking, .complaint select').dropkick({
change: function() {
var name = $(this)
.data("name"); //get priority name
if ($(".complaint select")
.val() === "Too_small" && $(this)
.val() == 1 && !$(this)
.data("increase_priority1")) {
//rank is 1, and not yet added to priority list
$("<option>", {
text: name,
val: name
})
.appendTo($increase_priority1);
$(this)
.data("increase_priority1", true); //flag as a priority item
}
if ($(this)
.data("increase_priority1") && $(this)
.val() != 1) {
//is in priority list, but now demoted
$("option[value=" + name + "]", $increase_priority1)
.remove();
$(this)
.removeData("increase_priority1"); //no longer a priority item
}
}
});
小提琴这表明这一背景下:http://jsfiddle.net/chayacooper/vWLEn/132/
我不明白这个问题... – 0x499602D2
你可能是想删除元素为$(this).val()!= 1 ** **或**'$(“.indusselect”) .val()!=“Too_small”'? – Kninnug
@Kninnug当这些语句中的任何一个不正确时,我需要删除元素。这是一个OR语句而不是AND? –