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



  • I love the code... dot com
    125,025

    iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > PRINT to Browser with document.write Command in Javascript

    PRINT to Browser with document.write Command in Javascript



    Inside your Javascript tags type:

    document.write('I see Paris');

    Which prints:
    I see Paris

    Simple enough. Now let's add a variable.


    var huhu="London";

    document.write('I see Paris but ' + huhu + ' is out of site.');

    Which prints:
    I see Paris but London is out of site.

    Plus symbols + allow you to connect the variable huhu to the rest of the sentence.

    You could have also done it like this:

    var huhu="London";

    document.write('I see Paris but ');
    document.write(huhu);
    document.write(' is out of site.');

    Same results with more typing.


    Copy and Paste Javascript Code:

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

    var huhu="Nikki";

    document.write('I see Paris but ' + huhu + ' is out of site.<br>');

    document.write('I see Paris but ');
    document.write(huhu);
    document.write(' is out of site.');

    -->
    </script>


    Javascript document.write - See in Action (new window)


    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Passing an Argument or Variable to a Javascript
    Next Article: Match with a Regular Expression, REGEX, in Javascript





    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $26.99

    HTML & XHTMLHTML & XHTML

    Chuck Musciano, Bi...

    New $29.99

    CSSCSS

    Eric Meyer

    New $29.69

    Information Architecture...Information Architecture for the Wor...

    Louis Rosenfeld, P...

    New $26.39

    CSSCSS

    David McFarland

    New $23.09

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

    Elizabeth Castro

    New $23.09

    Creating Web SitesCreating Web Sites

    Matthew MacDonald

    New $19.77

    New Perspectives on HTML...New Perspectives on HTML and XHTML 5...

    Partrick Carey

    New $67.45

    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69


    Of Interest:
  • Undefine an Array in Perl
  • Combine, Put Two Arrays Together in Perl
  • What Environmental Variables are Available
  • Write a WHILE LOOP in Perl, Carefully
  • Increment a Variable in Javascript
  • Use onLoad in Body Tag with Javascript
  • Getting Epoch Time in Javascript
  • Get Formatted Time in Javascript
  • HTML Body Tag
  • HTML Underline Text
  • Make Strikethrough Text Using HTML
  • Make a Line Return Using HTML

  • More Articles:
  • Finding the Length (Index Numbers) of an Array in Perl
  • Making a Directory Using mkdir in Perl
  • And, Or, Equal, Not Equal, Greater Than, Less Than in Perl
  • Passing a Variable or Value to a Subroutine in Perl
  • onClick Javascript
  • Environmental Variables Available in Javascript using Navigator Object
  • Getting Epoch Time in Javascript
  • Use OnMouseOver in Javascript
  • Get String Length with Javascript
  • HTML Tables
  • HTML Color Codes
  • HTML Codes
  • HTML Subscript Text

  • 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


    421,790
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:17 EDT