1. 程式人生 > >高版本js實現live

高版本js實現live

type blog clas ack yellow () alert back function

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <div class="add">
    <div class="plus" style="width:50px;height:50px;background-color: yellowgreen">abc</div>
    </div>
    <button id="btn">增加</button>
<script src="jquery-1.11.3.js"></script>
<script>
$("#btn").click(function(){
$(".add").append($(".add").html());
});
$(document).on("click",‘.plus‘,function(){
    alert(‘11‘);
});
</script>
</body>
</html>

高版本js實現live