jquery里边on方法

我们在高版本写on方法的时候

下边是一个例子,上边的未来元素没有加载,下边的未来元素可以加载
<script>
// $(".replyBt").on('click',
//    function () {
//        $("#commentReply textarea").attr("placeholder","回复@"+$(this).parent(".authorTxt").find(".authorName").text()+"...");
//        $(this).parent(".authorTxt").find(".commentCon").append($("#commentReply").show());
//    }
//)
 $(document).on('click','.replyBt',
    function () {
        $("#commentReply textarea").attr("placeholder","回复@"+$(this).parent(".authorTxt").find(".authorName").text()+"...");
        $(this).parent(".authorTxt").find(".commentCon").append($("#commentReply").show());
    }
) 	
</script>

  

原文地址:https://www.cnblogs.com/aoxueshou/p/7366429.html