{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Extra Credit - var length = prompt"Please enter a...

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

View Full Document Right Arrow Icon
<html> <head> <title> Extra Credit </title> </head> <body> <h1> Color Script </h1> <script type="text/javascript"> // Prompt for color and store as a variable var inputcolor = prompt("Please enter a color: ", ""); // Write the color in the color. document.write('<font color="'+inputcolor+'">Hello World</font>'); </script> <br><br><br><hr> <h1> Area Script </h1> <script type="text/javascript"> // Prompt user for length and width and store as variables
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 length = prompt("Please enter a length", ""); var width = prompt("Please enter a width", ""); // Calculate the Area and Perimeter and store as variables var area = (length * width); var perimeter = ((length * 2) + (width * 2)); // Display results document.write("The area of your rectangle is: " + area + ".<br>"); document.write("The perimeter of your rectangle is: " + perimeter + "."); </script> </body> </html>...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online