title: JavaScript or jQuery to select the last x letters in a string
body: <p>html:</p>
  <pre><code>&lt;select id=&quot;dropdown&quot;&gt;
  
  &lt;optgroup&gt;
  &lt;option&gt;11111&lt;/option&gt;
  &lt;option&gt;22222&lt;/option&gt;
  &lt;/optgroup&gt;
  
  &lt;optgroup&gt;
  &lt;option&gt;33333&lt;/option&gt;
  &lt;option&gt;44444&lt;/option&gt;
  &lt;/optgroup&gt;
  
  &lt;/select&gt;
  </code></pre>
  <p>I want to select the last 4 characters of the string in every <code>&lt;option&gt;</code>, then style them as <code>color:white;</code>. But I still need them to be there, just that no one can see.</p>
  <p>This is what I have:</p>
  <pre><code>let myStr = document.querySelector('#dropdown optgroup  option').innerHTML;
  let lastChar = myStr[myStr.length -4];
  </code></pre>
  <p>it only selects the second character in the string, maybe a for loop to select all last 4?</p>