Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. HTML Select tag

HTML Select tag

Scheduled Pinned Locked Moved JavaScript
javascripthtmltoolstutorialquestion
4 Posts 4 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    salmonraju
    wrote on last edited by
    #1

    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>

    W D H 3 Replies Last reply
    0
    • S salmonraju

      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>

      W Offline
      W Offline
      WoutL
      wrote on last edited by
      #2

      Works in Chrome. So maybe it is the browser fault?

      Wout Louwers

      1 Reply Last reply
      0
      • S salmonraju

        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>

        D Offline
        D Offline
        daveyerwin
        wrote on last edited by
        #3

        <!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

        1 Reply Last reply
        0
        • S salmonraju

          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>

          H Offline
          H Offline
          Hiren solanki
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups