javascript createElement(),  style problem
<p>today i wrote this function:</p>

<pre><code> function zoom(obj){
            var img = (!document.getElementById(obj))?false:document.getElementById(obj);
            var fullImage = (img.getAttribute("image") == null)?false:img.getAttribute("image");
            if(!fullImage || !img) { return false; }
            if(!document.getElementById("::img")) {
            var ob = "&lt;div id='::img' style='position:absolute;top:300px;left:300px;width:200px;height:200px;-moz-border-radius:100px;border:1px solid #ddd;-moz-box-shadow: 0px 0px 8px #fff;display:none;'&gt;&lt;/div&gt;";
            document.write(ob);}
            img.onmousemove = function(e) {
            var x = Math.floor(((e.pageX-7) - (img.offsetLeft - 8)) * 100 / img.width);
            var y = Math.floor(((e.pageY-7) - (img.offsetTop - 8)) * 100 / img.height);
            x = (x&gt;100)?100:(x&lt;0)?0:x;
            y = (y&gt;100)?100:(y&lt;0)?0:y;
            var ob = document.getElementById("::img");
            ob.style.background = "url('" + fullImage + "') no-repeat";
            ob.style.display = 'block';
            ob.style.backgroundPosition = x + '% ' + y + '%';
            ob.style.left = e.pageX + "px";
            ob.style.top = e.pageY + "px";
            }
            img.onmouseout = function() { document.getElementById("::img").style.display='none'; }
        }
</code></pre>

<ol>
<li><p>I tried to use createElement() and appendChild() functions instead of this :</p>

 <pre><code> var ob = `""`;
            document.write(ob);</code></pre>

<p>but function does't work, how to make it to work with createElement().</p></li>
<li><p>is it possible to add all style with one line code with pure <strong>JAVASCRIPT</strong> :</p></li>
</ol>

   <pre><code>ob.style.background = "url('" + fullImage + "') no-repeat";
                ob.style.display = 'block';
                ob.style.backgroundPosition = x + '% ' + y + '%';
                ob.style.left = e.pageX + "px";
                ob.style.top = e.pageY + "px";</code></pre>

<p><strong>Preview: <a href="http://jsfiddle.net/SfphR/8/" rel="nofollow">JsFiddle</a></strong></p>
