Can you please take a look at this demo and let me know why I am not able to select the after content
$("#yellow::after").on("click", function(){
alert("The after was clicked.");
});
div{background:yellow; height:200px; width:200px; margin-left:-210px;}
div::after {
content: "Content";
background-color:red;
margin-left:200px;
padding:15px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="yellow">
hi
</div>