0

Goal is to extract the text "Filter A" from the following ComputedStyle ...

    console.log(filters[0]);
    <td class="name" id="l:rcmrow0">
        ::before
        "Filter A"
    </td>
//
console.log(window.getComputedStyle(filters[0], ':before').getPropertyValue('content'));
console.log(window.getComputedStyle(filters[0], ':before').content);
//
var styles = getComputedStyle(filters[0], ':before');
console.log(styles.getPropertyValue('content'));
console.log(styles['content']);

All console.log outputs display "[]".

Please offer guidance on how to extract the pseudo element's text content.

J. Freese
  • 1
  • 1
  • Unfortunately, it's not possible. – Praveen Kumar Purushothaman May 25 '22 at 05:21
  • There may be some confusion - if what you show as being in the td element is a direct copy of what you are seeing in your browser's devtools inspect facility then the Filter A text is not in the content property of the before pseudo element but it's the actual text held in the td element. Try document.getElementById('l:rcmrow0').innerHTML – A Haworth May 25 '22 at 06:29

0 Answers0