Javascript Knowledge

  • what is javascript

  • javascript Variable
  • javascript function
  • javascript Event

  • JavaScript If
  • javascript for

  • javascript object
  • Javascript String
  • Javascript Date
  • Javacsript Array
  • Javascript Math

  • Javascript onclick
  • JavaScript onload

  • Javascript Frame
  • Javascript Image
  • Javascript Style
  • Javascript Textarea
  • Javascript Table
  • Javascript window
  • Javascript Location
  • Javacsript form
  • Javascript Checkbox
  • Javascript Input
  • Javascript Radio
  • Javascript Select
  • Javascript Submit

  • Javascript alert
  • Javascript close
  • Javascript confirm
  • Javascript Document open
  • Javascript getElementById
  • Javascript print
  • Javascript reload
  • Javascript remove
  • JavaScript replace
  • Javascript setTimeout
  • JavaScript split
  • JavaScript substring
  • Javascript window open
  • window showmodaldialog

  • Javascript href
  • Javascript IFrame
  • Javascript innerHTML
  • Javascript selectedindex
  • Javascript URL
  • Javascript window Location

  • javascript write to file
  • JavaScript write
  • javascript string to integer
  • Javascript popup
  • Javascript return
  • Javascript Obfuscator
  • Javascript disable
  • Javascript Hide
  • More others

    Javascript
    CSS
    PHP

     

    Javascript write


    JavaScript write

    One of the most basic JavaScript commands is document.write . This simply prints the specified text to the page. To print text literally, enter the text in single quote marks inside parentheses like so:

    document.write('Hello World!');

    The code above will cause the phrase "Hello World!" to appear on the page.

    You can also use document.write to print variables. Enter the variable name without quotes, like so:

    var mytext = "Hello again"; document.write(mytext);

    Note that if quote marks are placed around the variable name, the variable name itself will be printed (instead of the variable value). You can also combine variable values and text strings by using the + sign:

    var colour1 = "purple"; var colour2 = "pink"; document.write('<p>colour1: ' + colour1 + '<br>colour2: ' + colour2 + '</p>');

    Notice the way the variable names are used literally as well as for passing the values. This will print the following:

    colour1: purple
    colour2: pink

    Remember, text inside quotes will be printed literally, text with no quotes is assumed to be a variable.

     

     





















     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • Javascript |