Javascript examples for DOM HTML Element:Div
Taking div tag content and applying it to inline style
<html> <head> <script type="text/javascript"> function data(){/*w w w . java 2 s .co m*/ return parseFloat(document.getElementById('my').innerHTML.trim()); } </script> </head> <body> <div id="sizeChange"> <div id="my"> 40 </div> </div> <script type="text/javascript"> document.getElementById("sizeChange").style.fontSize = data() + "px"; </script> </body> </html>