Total members 11889 |It is currently Tue Mar 19, 2024 2:19 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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>




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 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     -  



Topic Tags

JavaScript Variables
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com