HTML Select tag
-
Hi I have an application that uses html select tag. My application provides different font sizes. When I am selecting font size which is more than current value. My HTML Select tag is enlarging accordingly but when I am reducing font size , my select tag is not reducing accordingly. I am still seeing large dropdown image. Can you please suggest how can i reduce drop down size. Please find below example. <html> <script language="javascript"> function ok_clicked() { document.getElementById('sel1').style.fontSize = 17; } function ok2_clicked() { document.getElementById('sel1').style.fontSize = 9; } </script> <body> <select id="sel1" style="font-size: 13px;"> <option>Volvo</option> <option>Saab</option> <option>Mercedes</option> <option>Audi</option> </select> <input type="button" name="Go2224" value="OK" onClick="ok_clicked();"> <input type="button" name="Go2222" value="Decrease font" onClick="ok2_clicked();"> </body> </html>
-
Hi I have an application that uses html select tag. My application provides different font sizes. When I am selecting font size which is more than current value. My HTML Select tag is enlarging accordingly but when I am reducing font size , my select tag is not reducing accordingly. I am still seeing large dropdown image. Can you please suggest how can i reduce drop down size. Please find below example. <html> <script language="javascript"> function ok_clicked() { document.getElementById('sel1').style.fontSize = 17; } function ok2_clicked() { document.getElementById('sel1').style.fontSize = 9; } </script> <body> <select id="sel1" style="font-size: 13px;"> <option>Volvo</option> <option>Saab</option> <option>Mercedes</option> <option>Audi</option> </select> <input type="button" name="Go2224" value="OK" onClick="ok_clicked();"> <input type="button" name="Go2222" value="Decrease font" onClick="ok2_clicked();"> </body> </html>
-
Hi I have an application that uses html select tag. My application provides different font sizes. When I am selecting font size which is more than current value. My HTML Select tag is enlarging accordingly but when I am reducing font size , my select tag is not reducing accordingly. I am still seeing large dropdown image. Can you please suggest how can i reduce drop down size. Please find below example. <html> <script language="javascript"> function ok_clicked() { document.getElementById('sel1').style.fontSize = 17; } function ok2_clicked() { document.getElementById('sel1').style.fontSize = 9; } </script> <body> <select id="sel1" style="font-size: 13px;"> <option>Volvo</option> <option>Saab</option> <option>Mercedes</option> <option>Audi</option> </select> <input type="button" name="Go2224" value="OK" onClick="ok_clicked();"> <input type="button" name="Go2222" value="Decrease font" onClick="ok2_clicked();"> </body> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<script type="text/javascript">
function ok_clicked(){
document.getElementById('sel1').style.fontSize = '17px';
}
function ok2_clicked(){
document.getElementById('sel1').style.fontSize = '9px';
}
</script>
<body>
<select id="sel1" style="font-size: 13px;">
<option>Volvo</option>
<option>Saab</option>
<option>Mercedes</option>
<option>Audi</option>
</select>
<input type="button" name="Go2224" value="OK" onclick="ok_clicked();">
<input type="button" name="Go2222" value="Decrease font" onclick="ok2_clicked();">
</body>
</html>modified on Tuesday, November 30, 2010 8:40 AM
-
Hi I have an application that uses html select tag. My application provides different font sizes. When I am selecting font size which is more than current value. My HTML Select tag is enlarging accordingly but when I am reducing font size , my select tag is not reducing accordingly. I am still seeing large dropdown image. Can you please suggest how can i reduce drop down size. Please find below example. <html> <script language="javascript"> function ok_clicked() { document.getElementById('sel1').style.fontSize = 17; } function ok2_clicked() { document.getElementById('sel1').style.fontSize = 9; } </script> <body> <select id="sel1" style="font-size: 13px;"> <option>Volvo</option> <option>Saab</option> <option>Mercedes</option> <option>Audi</option> </select> <input type="button" name="Go2224" value="OK" onClick="ok_clicked();"> <input type="button" name="Go2222" value="Decrease font" onClick="ok2_clicked();"> </body> </html>
salmonraju wrote:
document.getElementById('sel1').style.fontSize = 17;
Write
document.getElementById("sel1").setAttribute("style", "font-size: 13px");
Instead, It may work.
Regards, Hiren. "The more we give of anything, the more we shall get back." - Grace Speare (you can consider this quote while giving vote also) Microsoft Dynamics CRM