jQueryが代わりに青の私は1を置けば、それはそれをログに記録し、 </p> <p>
$(".1").each(function() {
if ($(this).text() == "blue") {
console.log("there");
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button class="1">
blue
</button>
<button class="1">
1
</button>
<button class="1">
Booked
</button>
$(this).text() == "apple"
のような正確な文字列値と比較すると、以前はinnerHtmlも同じように動作しますが、それでも何も表示されません。
RRKが大きなdifferenを行います余分な空白があるかもしれません比較しますOPのオリジナルHTMLでceを使用しており、特にOPの問題が空白であることに影響します – guradio