Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: Javascript

  1. #1
    New Coder
    Join Date
    Apr 2003
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript

    I am making a drop down box with a list of URL. You choose the URL that you would like to go to and then click the button. What I want to do is have on particular URL be a different color as it is used the most. Even bold would be fine. I have tried a couple of ideas but nothing is working. Can anyone help?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I dont think the select box is that dynamic
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #3
    Regular Coder
    Join Date
    Sep 2003
    Posts
    290
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ideally you would do...
    Code:
    <select>
      <option style="font-weight: bold">hello</option>
      <option>world</option>
    </select>
    However, only Netscape seems to support this at the moment.

  • #4
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't see what's wrong with this:

    <select>
    <option><strong>hello</strong></option>
    <option>world</option>
    </select>
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hehe I did the same thing you did jeff
    Yea it doesn't work on IE or some of the others I tried.

    Isn't it funny, If not all the time we are trying to figure out how to make it work in netscape and now its the other way around hehe
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #6
    Regular Coder
    Join Date
    Sep 2003
    Posts
    290
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't see what's wrong with this:
    <select>
    <option><strong>hello</strong></option>
    <option>world</option>
    </select>
    Well... first, it does not work in IE, Opera or Netscape. And second, using the STRONG element for only making bold text in incorrect usage of the element.

  • #7
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, so my code was untested. And yes, it was too early in the morning, would it be better if I used this?

    em {
    text-decoration: none;
    font-weight: bold}

    <option><em>Hi!</em></option>

    Although that won't work, it makes sense semantically.
    Last edited by me'; 10-05-2003 at 06:21 PM.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!


  •  

    Posting Permissions

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