This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes how to manipulate fonts? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to manipulate fonts?" Watch "how to manipulate fonts?" New topic

how to manipulate fonts?

Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

How can i give a specific font face,size,color in JavaScript?
document.fgColor = "blue"; means foreground color of all fonts but i want some particular fonts to manipulate as we did in HTML thru "<font face color size>Some</font>"....anyone help...
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!

Ashik Uzzaman
Senior Member of Technical Staff,, San Francisco, CA, USA.
David Kane
Ranch Hand

Joined: Sep 20, 2001
Posts: 65
There is a pretty good example of this at:
There are two keys to this code, that address your concern. First, use a DIV with ID attribute around the text you want to alter.
Second, the following line, gets this object and alters its CSS properties. The following line from the page above illustrates this.
Good luck!
David Kane
Author of Software Architecture: Organizational Principles and Patterns

David Kane<BR> <A HREF="" rel="nofollow"></A> <BR>Author of <A HREF="" TARGET=_blank rel="nofollow">Software Architecture: Organizational Principles and Patterns</A><BR><A HREF="" TARGET=_blank rel="nofollow"></A><BR><A HREF="" TARGET=_blank rel="nofollow"></A>
It is sorta covered in the JavaRanch Style Guide.
subject: how to manipulate fonts?
Similar Threads
view record from database using click event in jsp
How to check if textboxes are null
displaying image + JSP
One More Certification -- Bea Weblogic 7.0
Changing the color of a String variable