Results 1 to 3 of 3

Thread: Help with script

  1. #1
    Join Date
    Feb 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with script

    i need a way onClick to change the font color on a page useing a link. Is this possible? For an example i used this
    <a href="#" onClick="document.bgColor='navy'";>Navy</a>
    code to change the BG color, so can you use something like this
    <a href="#" onClick="document.font color='navy'";>Navy</a>
    to change the font color?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    HTML Code:
    <a href="#" onclick="document.body.style.color='navy';return false;">Navy</a>
    But, this is better:

    HTML Code:
    <span style="cursor:pointer;" onclick="document.body.style.color='navy';">Navy</span>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much.

Bookmarks

Posting Permissions

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