There is a function and a page, on that page there are a lot of different html blocks, I need to pull out a certain and several pieces. That is, pull the picture with the class: img1 and shove it in div1 also with the picture img2 and div2

 $(document).ready(function(){ $('#btn1').click(function(){ $.ajax({ url: "page1.html", cache: false, success: function(html){ $("#content").html(html); } }); }); }); 
  • From what you wrote and showed little in common .. Why do you need ajax? - haswell
  • @Haswell so i will get blocks - user292806
  • I do not see you working on the server..Ajax technology to interact with the server without reloading pages. - haswell

1 answer 1

 $(document).ready(function(){ $('#clickme').on('click', function(){ $('#div2').append($('.image')); }); }); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <div id='div1' style='background-color: yellow;'> БЛОК1: <img class='image' src='https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSKdpki1FyDbUGlSLqXk5s-w-ImMjZP6Y0DBNLjUSgPdb0rM1V5' /> </div> <div id='div2' style='background-color: orange;'> БЛОК2:</div> <button id='clickme'> Clickme! </button>