Total members 11380 |It is currently Sun Nov 23, 2014 9:20 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R

All times are UTC [ DST ]



  change font size in JavaScript
Thu Sep 15, 2011 8:31 pm 

Following example is on how to change the font size using JavaScript:
Code:

<html>
<
title>change font size</title>
<
head>
<
script language="JavaScript" type="text/javascript">
function changeSize(size){
    // change div text font size.
    document.getElementById("text").style.fontSize = size;
}
</script>
</head>
<body>
Select size:
<select name="sizeselect" onchange="changeSize(this.value)">
 <option value="10">10</option>
 <option value="13">13</option>
 <option value="15">15</option>
 <option value="17">17</option>
 <option value="19">19</option>
 <option value="21">21</option>
 <option value="23">23</option>
 <option value="50">50</option>
</select>
<div id="text">
  This is a font size changer using javascript .
</div>
</body>
</html>


_________________
Please recommend / share my post if you found it helpful.


Author:
Mastermind
User avatar Posts: 2694
Have thanks: 73 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : change font size in JavaScript
 How to use Javascript animation to change the size of a div?     -  
 chainge Font size of drawing     -  
 Control font size of sub and sup text     -  
 Change the td font style     -  
 change the font style of the body tag     -  
 change Font of text in java     -  
 Change the link font family and weight     -  
 Change Image File Size (Height And Width) While Uploading     -  
 Set image size as a percentage of the page size     -  
 CSS used font families     -  

All times are UTC [ DST ]



Topic Tags

JavaScript Variables






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team