javascript reciatation notes

javascript reciatation notes - var priceofpizza = prompt...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
<html> <body> <script type="text/javascript"> document.write( "<p>" + date() + "</p>" ); ---> shows the time </script> </body> </html> set up a variable and replace it with it var time; time = Date(); document.write( "<p>" + time + "</p>" ); ---> shows the time prompt(" how many pizza did you order?"); ---. pop out window var numbofpizza = prompt (" how many pizza did you order?")--> set variable document,write ("<p> you order" + numofpizza + " pizza. </p>"); ----> substitute varibale
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: var priceofpizza = prompt (&quot; what is the price for each pizza? &quot;); document,write (&quot;&lt;p&gt; price of each pizza is&quot; + priceofpizza + &quot; . &lt;/p&gt;&quot;); var cost = numberofpizza * priceofpizza; document,write (&quot;&lt;p&gt; the total cost is&quot; + cost + &quot; . &lt;/p&gt;&quot;); ---&gt; calculate the cost alert(&quot; the total cost is &quot; + cost + &quot;.&quot;);---&gt; pop out alert var isok = confirm(:the total cost is &quot; + cost + &quot;.&quot;); document,write (&quot;&lt;p&gt; the user's action is &quot; + isok + &quot; . &lt;/p&gt;&quot;);...
View Full Document

This note was uploaded on 12/28/2011 for the course 198 170 taught by Professor Kristianstout during the Spring '10 term at Rutgers.

Ask a homework question - tutors are online