WordPress.org

Support

Support » Themes and Templates » Basic Javascript Font Changer

Basic Javascript Font Changer

  • Hi guys,

    I received this code from a friend last week, and after trying it, the 20 and 40 links don’t do anything…

    http://technofinger.com/fontchanger.htm

    Any help would be much appreciated 🙂

    Thanks in advance,
    K

    <script language="JavaScript" type="text/javascript">
    function changeFontSize (fsize) {
    	var el = document.getElementById('content');
    	el.style.fontSize = fsize;
    }
    </script>
    <style type="text/css">
    <!--
    #header {
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 24px;
    	font-weight: bold;
    	color: #000000;
    	background-color: #FFFFCC;
    	padding: 10px;
    }
    #content {
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 14px;
    }
    -->
    </style>
    </head>
    <body>
    <div id="header"> Header Title </div>
    <div id="content">  <a href="#" onclick="changeFontSize(20);">20</a> <a href="#" onclick="changeFontSize(40);">40</a> <br />Content Line 1 <br />
        Content Line 1 </div>
  • The topic ‘Basic Javascript Font Changer’ is closed to new replies.
Skip to toolbar