I am new to jQuery and trying to inject the HTML content of one <div>
into another <div>
.
This is the code I'm using:
<div class="relatedItems"> </div>
<script>
jQuery.noConflict();
jQuery(document).ready(function() {
var related = jQuery("div.itemRelated").html();
jQuery("div.relatedItems").html("<div class='itemRelated'>" + related + "</div>");
});
</script>
The problem is that the injected HTML is not formatted the same way as the original.
I would love to post an image but can't because I'm a new user
Any ideas if I'm missing anything?