JavaScript Objects: Strings - The Big() Method
(Page 5 of 6 )
The Big method allows us to create text that is..well...uhhh...big. Here is a sample:
<html>
<body>
<script type="text/javascript">
var example="THIS IS BIG AND BEAUTIFUL TEXT!"
document.write("<p>This is normal text <br /><br />" + example.big() + "</p>")
</script>
</body>
</html>
This is the print out from the above code:
This is normal text
THIS IS BIG AND BEAUTIFUL TEXT!
As you can see, we create a variable named example and store some text in it. Then we print an example of normal text using the document.write command, followed by an example of big text, using the example.big() method.
The Blink() Method
While it does not work in Internet Explorer, the Blink() method is still pretty cool. In other browsers it creates blinking text. In Internet Explorer it simply displays the text as normal.
<html>
<body>
<script type="text/javascript">
var blinking="Now you see me now you don't!"
document.write("Blink: " + blinking.blink())
</script>
</body>
</html>
This results in: Blink:
Next: The Bold() Method >>
More JavaScript Articles
More By James Payne