JavaScript’s String object provides functions that display style of the text:
- big()
- blink()
- bold()
- fixed()
- fontsize(<size>): This function takes a parameter to specify the font-size in pixels.
- fontcolor(“
“) : This function takes a string parameter to specify font-color. - italics()
- link(“
“) : This function takes a string parameter to specify the URL. - small()
- strike()
- sub()
- sup()
- toLowercase()
- toUppercase()
For example, to display selected text in italics:
var text = "Hi there!"document.write(text.italics()) //writes the string in italics
To set a link to a text:
document.write(text.link("http://www.devx.com")) //writes a hyperlinked string text