title: Is it possible to take the text inside of a element and display it ::Before css
body: <p>Im working on a table, and was trying to figure out a more automatic way to fill in the <code>::before content: ' ';</code></p>
  
  <pre><code>&lt;table&gt;
     &lt;thead&gt;
       &lt;tr&gt;
        &lt;th id="text"&gt;word&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
  </code></pre>
  
  <p>I was trying to use javaScript to do this.</p>
  
  <pre><code>table th:nth-child(1)::before {
      content: attr('');
  }
  </code></pre>
  
  <p>is it possible to use javascript to get the text inside the id "text" and use it in css to display it using ::before "word"?</p>