Tecvid,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
div{
display: inline-block;
padding: 10px;
background-color: #0000CD;
}
b{
background-color: #FFD700;
color: #FF0000;
}
</style>
</head>
<body>
<b>test</b>
<script>
function wrap(createEelem, currentElem)
{
var parentElem = currentElem.parentNode;
currentElem = parentElem.replaceChild(createEelem, currentElem);
createEelem.appendChild(currentElem)
}
var createEelem = document.createElement('div'), currentElem = document.querySelector('b');
wrap(createEelem, currentElem)
</script>
</body>
</html>