Skip to main content

Activity : Using the Assignment Operator

  1. Start your text editor
  1. In the empty file, type the following:
 
  <Script Language="JavaScript">
  var EarningsJob1, EarningsJob2;
  
  EarningsJob1 = 325.38;
  EarningsJob2 = 580.64;
  
  document.write("<p>Salaries</p>");
  document.write("Job 1: $");
  document.write(EarningsJob1);
  document.write("<br/>");
  document.write("Job 2: $");
  document.write(EarningsJob2);
</Script>
 

3. Save the file as operators.htm in the JavaScript Lessons folder

4. Preview the file in the browser and return to your text editor

Next: Text Data Types