The jQuery API .appendTo() method will take whatever is in the selector and append it to every element that matches what is in the following parentheses. It removes the original element from the HTML. If you wish to keep the original HTML element, you can combine .clone() with .appendTo().

For instance:

$("#todaysInfo").appendTo(".rateBox");

<span id="todaysInfo">4.128%</span/>
<h3 class="rateBox">Today's Rate: </h3>
<h3 class="rateBox">Calc Rate: </h3>
<h3 class="rateBox">Target Rate: </h3>

The result is:

Today's Rate: 4.128%

Calc Rate: 4.128%

Target Rate: 4.128%

 

The difference between .appendTo() and .append()

There is a big difference between .appendTo() and .append().

.appendTo() will take the CONTENTS OF THE ELEMENT in the parentheses and append it to all elements that match the selector.

.append() will take what is in the parentheses themselves and add it to all elements that match the selector.