...

View Full Version : Two quick, easy questions



chamith7
07-02-2004, 04:22 PM
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

Willy Duitt
07-02-2004, 04:39 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum