<div id="test"></div>
<script>
var case1 = '123123 <b>7</b> asdads';
var case2 = ' <div> asdnaslklj ';
var box = document.getElementById( 'test' );
box.innerHTML = case1;
alert( case1 === box.innerHTML );
box.innerHTML = case2;
alert( case2 === box.innerHTML );
</script>