Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bold Text (sounds too simple)

Status
Not open for further replies.

KevinFSI

Programmer
Nov 17, 2000
582
US
I posted this once before but screwed up the subject, so here it is again:

Is there any way to take the following code and manipulate the fonts (bold/italic/etc...) of individual parts of the text in "MyText" rather than the text as a whole? In other words, can I make just one word bold? Isn't there something like
Code:
string.bold()
? I think
Code:
string.bold()
just throws some <B></B> tags around the string though. As you can see, I'm lost!
Thanks,
Kevin

Code:
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
   MyFont  = &quot;Arial,9&quot;
   MyText  = &quot;-- Hourly Employees --\n\n&quot;
   MyText += &quot;*  You earn 40 hours of sick leave each year, although you may not use any during your first three\n&quot;
   MyText += &quot;   months of employment.\n\n&quot;
   MyText += &quot;*  If earned sick leave has not been used at the end of the year, the balance will be paid to you.\n\n&quot;
   MyText += &quot;*  Although sick days are given to provide continued income when you are unable to go to work because\n&quot;
   MyText += &quot;   of your health, you will be allowed to use these days for time off for other personal reasons also.&quot;
</SCRIPT>
<OBJECT
    id=popup
      type=&quot;application/x-oleobject&quot;
      classid=&quot;clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11&quot;>
</OBJECT>


<FORM ACTION=&quot;JavaScript:popup.TextPopup(MyText,MyFont,9,9,-1,-1)&quot;>
 
Not sure...you may want to consider ditching the active x control. It is possible to create crossbrowser tool-tips. They are almost simple to make in IE5+ and you would be able to manipulate all of the text to your hearts content (using innerHTML,innerText, and/or TextRange) jared@aauser.com
 
Thanks for the info. Where can I learn more?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top