...

View Full Version : default fontsize



jstewie
07-13-2005, 02:56 PM
This should be simple but it's not, atleast for me, I'm trying to get the default fontsize to 14 and have the option as "default" in the javascript. <DFSIZE='14'></DFSIZE='14'>

<script type="text/javascript">
function SelectSize()
{
var dropDown=document.getElementById("size");
var SelectedSize = dropDown.options[dropDown.selectedIndex].text;
document.body.style.fontSize=SelectedSize;
}
</script>
Change Size of Text
<form name="frmcontrol">
<select id=size onChange="SelectSize()" >
<option value= "something I need help with">Default
<option value="8">8px
<option value="12">12px
<option value="18">18px
</select>
</form>

jbot
07-13-2005, 03:04 PM
function SelectSize()
{
var dropDown=document.getElementById("size");
var SelectedSize = dropDown.options[dropDown.selectedIndex].value;
document.body.style.fontSize=SelectedSize + "px";
} :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum