javascript - Setting style doesn't work? -


why script not work?

<!doctype html> <html>      <head>         <title>hello stackoverflow!</title>     </head>      <body>         <div id="testing">             <p>bladybla</p>         </div>         <script>             var 1 = window.innerwidth;             var 2 = 5;             var 3 = 1 / two;             var 4 = '"' + math.round(three) + "px" + '"';             document.getelementbyid("testing").style.margintop = four;         </script>     </body>  </html> 

when place alert between var four , document.getelementbyid calculates right value. problem in .style.margintop = . doesn't print calculated value. why?

thanks in advance, jaapyse!

var 4 = math.round(three) + "px"; 

fiddle


Comments