155k views
4 votes
Provide code to create a selection list named orderDay containing the values and option text SAT and SUN placed in the Weekend option group, and the option text MON, TUE, WED, THU, and FRI placed in the Weekday option group.

User Zhen Liu
by
6.0k points

1 Answer

3 votes

Answer:

<!DOCTYPE html>

<html lang="en">

<head>

<!--title for web page -->

<title>Question 1</title>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

</head>

<body>

<!-- Creation of selection list -->

<select name="orderDay">

<!-- Creation of Weekday option group-->

<optgroup label="Weekday">Weekday</optgroup>

<option value="MON">MON</option>

<option value="TUE">TUE</option>

<option value="WED">WED</option>

<option value="THU">THU</option>

<option value="FRI">FRI</option>

<!-- Creation of Weekend option group-->

<optgroup label="Weekend">Weekend</optgroup>

<option value="SAT">SAT</option>

<option value="SUN">SUN</option>

</select>

</body>

</html>

Step-by-step explanation:

The above code can be saved as orderDay.html. When it is clicked open it opens into a browser where we have an output which is a dropdown box showing the days under the weekday group and the days under the weekend opton group.

User Pierce Griffiths
by
5.0k points