iLTC Home
Bookmark iLTC!
iLTC Google Boards

Google Groups
Receive The Code in Email!



Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • Perl with cheese...
    20,097

    iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > Javascript Subscript Text

    Javascript Subscript Text



    j="TM";

    j=j.sub();

    document.write("This is a good time." + j);

    Which Prints:
    This is a good time.TM

    -We created a variable and named it j because the letter j is a fine letter.
    -We applied Javascript's built-in sub method to our j string.
    -We stored those results back into j.
    -We used Javascript's built-in document.write to print to the browser.


    We could have also written this a little differently, like so:

    j="TM";

    document.write("This is a good time." + j.sub());


    ADVANCED: You can also apply more than one method to the string:

    j="TM";
    j=j.italics().sub().link('http://google.com');
    document.write("This is a good time." + j);

    or

    j="TM";
    document.write("This is a good time." + j.italics().sub().link('http://google.com'));


    Free Copy and Paste Javascript Code:

    <script type="text/javascript">
    <!--

    i="TM";
    j=i.sub();

    document.write(i);
    document.write(j);
    document.write("This is a good time." + i.sub());

    -->
    </script>


    Resources:
    Make Text Bold Using Javascript
    Italic Text in Javascript
    Redirect in Javascript
    Status Bar in Javascript
    Change Fonts in Javascript


    Sun Javascript Documentation on Strings

    HTML Tags
    HTML Color Chart
    HTML Codes


    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Make Text Blink Using Javascript
    Next Article: Javascript Superscript Text





    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    Pro CSS and HTML Design ...Pro CSS and HTML Design Patterns

    Michael Bowers

    New $29.69

    HTML, XHTML, and CSS, Si...HTML, XHTML, and CSS, Sixth Edition ...

    Elizabeth Castro

    New $23.09

    CSSCSS

    Eric Meyer

    New $29.69

    Bulletproof Web DesignBulletproof Web Design

    Dan Cederholm

    New $26.39

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39

    Creating Web SitesCreating Web Sites

    Matthew MacDonald

    New $19.77

    Head First HTML with CSS...Head First HTML with CSS & XHTML

    Eric Freeman, Elis...

    New $26.39


    Of Interest:
  • What's in an Array, Index Numbers
  • Passing a Variable or Value to a Subroutine in Perl
  • Making a Directory Using mkdir in Perl
  • Write a WHILE LOOP in Perl, Carefully
  • Splitting an Array using Javascript
  • Javascript Subscript Text
  • Javascript Bold Text
  • Javascript Unshift - Use Unshift to Put Items on the Front of an Array in Javascript
  • HTML Center
  • HTML Image
  • HTML Color Chart
  • Make Italic Text Using HTML

  • More Articles:
  • Finding the Length (Index Numbers) of an Array in Perl
  • Getting What is Matched in Perl
  • If, Elsif, and Else in Perl
  • OPEN and READ a Data File in Perl
  • Javascript Change Font Size
  • onClick Javascript
  • Javascript Change Fonts
  • Javascript Change Background Colors
  • Javascript Slice - Use Slice to Get Items from an Array in Javascript
  • Make a String into a Link in Javascript
  • If, Else If, and Else in Javascript
  • Get Query String Using Javascript
  • HTML Title Tag
  • HTML Body Tag
  • HTML Subscript Text
  • HTML Color Codes

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    316,837
    Counter by iLoveTheCode.com


    Last Modified: Sunday, 09-Jul-2006 01:40:46 EDT