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 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2004
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Two quick, easy questions

    What is the code for putting a comma (,) and an apostrophe (') in a code.

    For instance, I need a comma in:

    quotes[5]='Brilliance delivered daily'


    Secondly,
    How can I change this so that I can specify the font, font size, and make it bold or italic:

    document.write(quotes[whichquote])

    Thank you very much

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by chamith7
    What is the code for putting a comma (,) and an apostrophe (') in a code.

    For instance, I need a comma in:

    quotes[5]='Brilliance delivered daily'


    Secondly,
    How can I change this so that I can specify the font, font size, and make it bold or italic:

    document.write(quotes[whichquote])

    Thank you very much
    1) Just add the comma but you will need to escape the single quote with a backslash (\) if your string is delimited with single quotes.

    IE:
    quotes[5]='Brilliance, deliver\'d daily'

    2) Place your quote which is being written to the page within a span and add style to that.

    IE:
    document.write('<span style="font-family:cursive; font-size:20px; font-decoration:italic">'+quotes[whichquote]+'</span>');

    .....Willy
    Last edited by Willy Duitt; 07-02-2004 at 04:41 PM.


  •  

    Posting Permissions

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