var selectedColor = document.getElementById(\"colorChoice\").value; var selectedStyle = document.getElementById(\"style\").value; var selectedSize = document.getElementById(\"size\").value; var orderMessage = \"Your order is: Color...

70.2K

Verified Solution

Question

Programming

var selectedColor =document.getElementById(\"colorChoice\").value;
var selectedStyle = document.getElementById(\"style\").value;
var selectedSize = document.getElementById(\"size\").value;

var orderMessage = \"Your order is: Color = \" +selectedColor
+ \"; Style = \" + selectedStyle
+ \"; Size = \" + selectedSize+\"\n\";

if (selectedStyle===\"Long-sleeve\")
//Add code to calculate the price and concatenate it to theorderMessage
//For example, \"The order is: Color = gray; Style=T-Shirt; Size =XL \nThe price is $12\"
//If the style and size are not available, then concatenate themessage that it is not available instead of a price.
// -- Notice: the color, style, and style is already storedvariables for you
// a t-shirt in any size is $9
// a long-sleeve t-shirt in adult sizes is $18
// a long-sleeve t-shirt is youth sizes is not available
// a tech shirt is is $12 except 2XL and 3XL which are $16.


alert(orderMessage);
//Next change this alert to write the order status to the HTMLpage.
}

Answer & Explanation Solved by verified expert
4.1 Ratings (842 Votes)
var selectedColor documentgetElementByIdcolorChoicevalue var selectedStyle documentgetElementByIdstylevalue var selectedSize documentgetElementByIdsizevalue var orderMessage Your order is Color selectedColor Style selectedStyle Size selectedSize if selectedStyle is longsleeve case insensitive comparison toLowerCase method converts the string to lower case so the comparison can be    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students