<!DOCTYPE HTML>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
</head>
<body>
<style>
.div {background: black; color: white;display: inline-block;}
.divWrap {background: red;padding: 20px;display: inline-block;}
</style>
<script>
$('<div class="div">Some text</div>').appendTo('body');
$(".div").wrap("<div class='divWrap'></div>");
</script>
</body>
</html>