我需要等於二值,但它不會工作。jquery。如何平等的.text().VAL()
var rowID = $("#@idSelectObjectGuid").val();
$($(".ls-grid-body tr").children("[email protected]")).each(function() {
alert($(this).text() + " == " + rowID);
if ($(this).text() == rowID) {
$(".ls-grid-body tr").removeClass("lst-state-selected");
$(this).addClass("lst-state-selected");
}
});
警報結果:
df5ebd84-14a1-4e57-9f38-32d4e84e1503 - 41 == df5ebd84-14a1-4e57-9f38-32d4e84e1503 - 36
爲什麼第一lenght是41,爲什麼他們不等於...
如何做到這一點?
是41你的長度?從你的代碼看起來是rowid – Tushar 2014-09-23 11:06:18
@TusharGupta是'$(this).text()'* – andlrc 2014-09-23 11:13:48