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



  • Pass the Javascript, please...
    20,064

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

    Javascript Superscript Text



    j="2";

    j=j.sup();

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

    Which Prints:
    This is a good time.2

    -We created a variable and named it j because the letter j is a lovely letter.
    -We applied Javascript's built-in sup 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="2";

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


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

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

    or

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


    Free Copy and Paste Javascript Code:

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

    i="2";
    j=i.sup();

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

    -->
    </script>


    Resources:
    Make Text Subscript Using Javascript
    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: Javascript Subscript Text
    Next Article: Javascript Uppercase Text





    CSSCSS

    Eric Meyer

    New $29.69

    CSSCSS

    David McFarland

    New $23.09

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

    Michael Bowers

    New $29.69

    DojoDojo

    Matthew A. Russell...

    New $26.39

    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $29.69

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

    Elizabeth Castro

    New $23.09

    Struts 2 in ActionStruts 2 in Action

    Don Brown, Chad Da...

    New $29.69

    CSS MasteryCSS Mastery

    Andy Budd, Simon C...

    New $23.09


    Of Interest:
  • Redirect to a Different URL in Perl
  • Renaming a File with Perl's RENAME Function
  • Write a FOREACH LOOP in Perl
  • Combine, Put Two Arrays Together in Perl
  • Exit a For Loop in Javascript with Break
  • Javascript Referrer
  • Environmental Variables Available in Javascript using Navigator Object
  • Javascript Lowercase Text
  • Make a New Paragraph Using HTML
  • HTML Status
  • Make a Line Return Using HTML
  • HTML Color Chart

  • More Articles:
  • If, Elsif, and Else in Perl
  • Delete a File Using unlink in Perl
  • Matching at the Beginning and End 2
  • Combine, Put Two Arrays Together in Perl
  • Javascript Change Background Colors
  • Javascript Change Font Size
  • Javascript Change Fonts
  • Javascript Alert
  • Opening an Alert Box in Javascript
  • Get Query String Using Javascript
  • Javascript Referrer
  • Environmental Variables Available in Javascript using Navigator Object
  • HTML Link
  • Make a New Paragraph Using HTML
  • HTML Space
  • HTML Tables

  • 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,804
    Counter by iLoveTheCode.com


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