moving html to a div

moving html to a div

by Fernando De Leon

HTML

<div id="devices">
	<div class="row">
	   <div class="col-md-6">
		 <p>Name : {{name}}</p>
		 <p>Size : {{size}}</p>
	   </div>
	 </div>
 </div>
 <div id="devices2">
	<div class="row">
	   <div class="col-md-6">
	     <h3>In template no 2</h3>
		 <p>Name : {{name}}</p>
		 <p>Size : {{size}}</p>
	   </div>
	</div>
 </div>
 <button id="button">Press here
 </button>
 <span id="displayHere"></span>

JavaScript

$("#button").on("click", function() {
  var devicesHtml = $("#devices2").html();
  $("#displayHere").html(devicesHtml);
});