JSFiddle - React, Tailwind, and code Playground

HTML

<div>
test
</div>

CSS

div:before {
    content: '1. ';
}

JavaScript

console.log($('div').prev()); // this is empty
console.log($('div:before')); // this returns the whole div
$('div:before').css('color', 'red'); // this is wrong, only the "1. " should be red