I have a very simple element:
How can I check if this element contains the ::after using Javascript?
(I have the element using document.getElementsByTagName('h2')[0]
)
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...
In some cases the element looks like this:
I need to be able to detect both cases, if possible!
Check this link, explains how to use it in plain JavaScript (might only work in newer browsers): http://davidwalsh.name/pseudo-element
Edit: if you're looking to edit what the content of the :after is, reference this SO question: Selecting and manipulating CSS pseudo-elements such as ::before and ::after using jQuery