title: Javascript: check for ::after in element
body: <p>I have a very simple element:<br>
  <a href="https://i.stack.imgur.com/4uRO7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4uRO7.png" alt="enter image description here"></a><br>
  How can I check if this element contains the ::after using Javascript?</p>
  
  <p>(I have the element using <code>document.getElementsByTagName('h2')[0]</code>)</p>
  
  <p>I don't know how the thing works, and I don't need to know, I just need the code to see if it exists...</p>
  
  <p>In some cases the element looks like this:<br>
  <a href="https://i.stack.imgur.com/a27aV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a27aV.png" alt="enter image description here"></a><br>
  I need to be able to detect both cases, if possible!</p>