JavaScript Examples

Working with Data

  • Arithmetic
  • Arithmetic Operators
  • Order of Operations
  • window.prompt()
  • Label for window.prompt()
  • Empty window.prompt() text box (for Netscape)
  • window.prompt() and window.document.write()
  • window.document.write() and HTML outside of <SCRIPT> tags
  • Using window.document.write() to output all of the HTML
  • Concatenation - use only 1 window.document.write() statement
  • Using a value again - w/o a variable, impossible
  • Variable
  • Variable (same example, this time using concatenation)
  • Modifying a Variable
  • Calculator - multiplies only
  • Calculator - adding problem
  • Calculator - adding problem fixed
  • Calculator - user chooses the operation
  • Calculator - display the expression w/ result
  • Status Messages
  • bgcolorizer
  • circling text

Return to Examples main menu