Changing or setting font size of <span> field - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Span

Description

Changing or setting font size of <span> field

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//ww w  . j a  va 2s  . com
var secondsPerMinute = 60;
var minsPerHour = 60;
var hoursPerDay = 24;
var daysPerWeek = 7;
var weeksPerYear = 52;
var secondsPerDay =  secondsPerMinute*minsPerHour*hoursPerDay;
document.write('<span style="font-size: 10px">' + secondsPerDay + '</span>');

    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials