我刚开始学习JavaScript和jQuery。
根据表格单元格的值,我正在设置其backgroundColor
。
$("td.ms-vb2").filter(function(index){return $(this).text() === "Yes";}).css("backgroundColor", "#81F79F");
$("td.ms-vb2").filter(function(index){return $(this).text() === "No";}).css("backgroundColor", "#FE642E");
请问我应该如何编写if-else语句,其中当颜色为#81F79F
时进行提示,而当颜色为#FE642E
时进行另一个提示?
或者说,如果单元格中的值为Yes,则进行提示,而当单元格中的值为No时,进行另一个提示。
非常感谢!