Получите ценность CSS Pseudo Properties JS

<div class="element"> This is my element </div>

.element { background-color: red }
.element::before { content: "Before pseudo element"; }

const element = document.querySelector('.element')
pseudoElementStyle = getComputedStyle(element, '::before')

console.log(pseudoElementStyle.content) // Before pseudo element
honeyCodedAsterisk