i have a problem on window resize. I should to append one time on resize an element to anather div but it appedn more times. How can i fix it ? Here you can find an example, resize window more time and after that click on first div and you will see the problem :
$(window).on('resize', function() { var windowW = $(window).width(); console.log(windowW); if(windowW <= 670){ $('.take').on('click touchstart', function(){ var info = $(this).text(); $('.add').append('<p>Inormation :'+info+'</p>'); }); } else { $('.add').empty(); } }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <div class="take">Some information </div> <div class="add"> </div>