Uncaught SyntaxError: missing ) after argument list when use data-label
Uncaught SyntaxError: missing ) after argument list when use data-label
我使用此代码更改文本颜色。
如果我使用 $("tr:visible td:last-child").each(function() {
但是在使用 data-label
时出现“错误 Uncaught SyntaxError: missing ) after argument list”
示例:AAAAA 是列的名称 header
请查看并提供帮助
谢谢
//$("tr:visible td:last-child").each(function() {
$("tr:visible td data-label="AAAAA" ").each(function() {
if ($(this).text() == "Work") {
var colorforcell = '<div style="background-color: yellow ">'+$(this).text()+'</div>';
};
$(this).html(colorforcell);
});
嵌套引号时需要转义引号或使用其他类型。
$('tr:visible td data-label="AAAAA"').each(function() {
if ($(this).text() == "Work") {
var colorforcell = '<div style="background-color: yellow ">'+$(this).text()+'</div>';
};
$(this).html(colorforcell);
});
我使用此代码更改文本颜色。
如果我使用 $("tr:visible td:last-child").each(function() {
但是在使用 data-label
时出现“错误 Uncaught SyntaxError: missing ) after argument list”示例:AAAAA 是列的名称 header
请查看并提供帮助
谢谢
//$("tr:visible td:last-child").each(function() {
$("tr:visible td data-label="AAAAA" ").each(function() {
if ($(this).text() == "Work") {
var colorforcell = '<div style="background-color: yellow ">'+$(this).text()+'</div>';
};
$(this).html(colorforcell);
});
嵌套引号时需要转义引号或使用其他类型。
$('tr:visible td data-label="AAAAA"').each(function() {
if ($(this).text() == "Work") {
var colorforcell = '<div style="background-color: yellow ">'+$(this).text()+'</div>';
};
$(this).html(colorforcell);
});