<script type="text/javascript">
function add(a,text){
$(a).append('<div class="each_block"><div class="click">click</div><div class="text">'+text+'</div></div>')
$( "body" ).on('click', '.click', function() {
$(this).closest('.each_block').find('.text').css('color','red');
})
}
</script>
for {
<div class="block"></div>
<script type="text/javascript">
add('.block',val)
</script>
}