Clicking on css content property

后端 未结 2 383
别那么骄傲
别那么骄傲 2021-01-22 01:41

The Following code adds an image before header tag. How can add javascript or jquery code for handling some task when the image added before the header was clicked.



        
2条回答
  •  盖世英雄少女心
    2021-01-22 02:18

    Pseudo elements such as :before and :after in CSS aren't part of the DOM and can't be altered or interacted with javascript. You would need to add the image to a 'real' element and attach the event handlers to that if you want it to be interacted with.

提交回复
热议问题