Html:
<div id='templates' style='display:none;'>
<div class='latest-price'>
<div class='price-value'></div>
</div>
</div>
Javascript:
$.getJSON(url,
function(dt){
if (dt.success){
var template = $('#templates > div');
var clone = template.clone();
clone.find('.price-value').text(dt.data[0].value);
clone.appendTo($('#parent-block'));
}
});
CSS:
.latest-price .price-value{
color: red;
}
Добавлено:<html>
<body>
<style>CSS</style>
<div>
<div id='parent-block'></div>
Код выше
</div>
<script>Javascript </script>
</body>
</html>