如何根据评级值在 if/else 块中显示或不显示 div。谁能帮我。
<td> <div class="AutoMaticRatingStars floating-left" Rating="<%#DataBinder.Eval(Container.DataItem, "AutomaticRating") %>"> </div>
<div class="NoRatingAvailable floating-left ">
no data
</div>
</td>
$('div[Rating]').each(function () {
if (this.getAttribute("Rating") == "" || this.getAttribute("Rating") == 0) {
$(".NoRatingAvailable").css("display", "inline");
$(".AutoMaticRatingStars").css("display", "none");
}
}
);