请您看看这个演示,让我知道为什么我无法选择后续内容
$("#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>
答案 0 :(得分:1)
试试这个:
$("#yellow").after().on("click", function(){
alert("The after was clicked.");
});