Home arrow JavaScript arrow Page 5 - JavaScript Objects: Strings
JAVASCRIPT

JavaScript Objects: Strings


In our last tutorial we covered JavaScript Errors. We learned to work with the OnError event, the Try...Catch statement, and Throw to create exceptions. In this episode we will go over JavaScript String Objects and learn to use them.

Author Info:
By: James Payne
Rating: 5 stars5 stars5 stars5 stars5 stars / 3
January 14, 2008
TABLE OF CONTENTS:
  1. · JavaScript Objects: Strings
  2. · Length Property
  3. · Prototype
  4. · The Anchor() Method
  5. · The Big() Method
  6. · The Bold() Method

print this article
SEARCH DEVARTICLES

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:Now you see me now you don't!


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- Project Nashorn to Make Java, JavaScript Wor...
- JavaScript Virus Attacks Tumblr Blogs
- Google Releases Stable Dart Version, JavaScr...
- Khan Academy Unveils New JavaScript Learning...
- Accessing Nitro? There`s an App for That
- JQuery 2.0 Leaving Older IE Versions Behind
- Fastest JavaScript Engine Might Surprise You
- Microsoft Adjusting Chakra for IE 10
- Brendan Eich: We Don`t Need Google Native Cl...
- An Overview of JavaScript Statements
- An Overview of JavaScript Operators
- Overview of JavaScript Variables
- More of the Top jQuery Social Plugins
- The Top jQuery Social Plugins
- More of the Top jQuery Slider Plugins

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials