Results 1 to 4 of 4

Thread: Javascript <select> Question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    Somerset, UK
    Posts
    93

    Unhappy Javascript <select> Question

    I have seen somewhere, different items in a dropdown (<select></select>) are bold and some are not - can I find this again?


    Anybody knows how??

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Use a inline style tag on the Option tags that you want bold:

    Code:
    <select>
      <option style="font-weight: bold" value=1>One</option>
      <option value=2>Two</option>
      <option value=3>Three</option>
      <option style="font-weight: bold" value=4>Four</option>
      <option value=5>Five</option>
      <option style="font-weight: bold" value=6>Six</option>
    </select>
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    Somerset, UK
    Posts
    93
    Cheers monte96 for the reply - but it doesn't seem to work (i'm Using IE 6), but anyway thanks but I eventually found the page - I was trying to do :-

    <select name="SiteNo" style="width:245">
    <optgroup label="Main Heading 1">
    <option value="1">One
    <option value="161">Two
    <option value="2">Three
    </optgroup>
    <optgroup label="Main Heading 2">
    <option value="171">Four
    </optgroup>
    </select>

  4. #4
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    IE 6 supports OPTGROUP? Holy Freakin' Cow!!!
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width