I am trying to implement a specific style when an if statement is executed, but Jquery is encountering syntax issues and generating errors. Does anyone have a solution for escaping these errors so that I can still apply the desired styling?
The problematic Jquery code causing errors is as follows:
$("#inject-toc-here > ol > li::before").css("content", "counters(item, ".") " "");
The correct CSS code should look like this:
#inject-toc-here ol li::before {
content: counters(item, ".") " ";
}
The issue seems to arise from the second value in the CSS, particularly the inverted commas around counters(item...).
Any help would be greatly appreciated. Thank you in advance :)