There are two blocks. It is necessary that when clicking on block No. 2, the action of clicking on block No. 1 did not work.
$(document).ready(function(){ $(document).on('click', '.b_1', function(event){ var target = $(event.currentTarget); target.css({ color: 'white' }); }); }); $(document).ready(function(){ $(document).on('click', '.b_2', function(event){ var target = $(event.currentTarget); target.css({ color: 'white' }); }); }); .b_1, .b_2 { height: 40px; color: black; } .b_1 { width: 200px; background-color: blue; } .b_2 { width: 40px; background-color: red; float: right; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class='b_1'>1 <div class='b_2'>2</div> </div>