Can I use a :before or :after pseudo-element on an input field?

I am trying to use the :after CSS pseudo-element on an input field, but it does not work. If I use it with a span, it works OK. <style type=”text/css”> .mystyle:after {content:url(smiley.gif);} .mystyle {color:red;} </style> This works (puts the smiley after “buu!” and before “some more”) <span class=”mystyle”>buuu!</span>a some more This does not work – … Read more

Selecting and manipulating CSS pseudo-elements such as ::before and ::after using javascript (or jQuery)

Is there any way to select/manipulate CSS pseudo-elements such as ::before and ::after (and the old version with one semi-colon) using jQuery? For example, my stylesheet has the following rule: .span::after{ content:’foo’ } How can I change ‘foo’ to ‘bar’ using vanilla JS or jQuery? 25 s 25 You could also pass the content to … Read more