Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. In a simple page (no images or elaborate design needed), Create a page with a

ID: 641544 • Letter: 1

Question

1.      In a simple page (no images or elaborate design needed), Create a page with a select box in which you ask the user whether or not they have registered to vote in the upcoming Chicago election for mayor.  The two select options should simply be 'Yes' or 'No'.  

2.      The values for this select box should be '1' (for the  'Yes' option) and '2' (for the 'No' option).  

3.      In your script, retrieve the value that the user selected from the select box, and store that value (i.e. the '1' or the '2') in a variable.

4.      If they selected 'Yes', output Great

Explanation / Answer

<!-- You did small mistakes in your code, everything else is perfectly alright. I mentioned your mistakes in comments -->

<!DOCTYPE html>
<html lang="en">
<head>
<!-- This is to include CSS file -->
<link type="text/css" rel="stylesheet" href="example.css">
<meta charset="utf-8">
<title>Voter Registration Inquiry</title>
<script type="text/javascript">
function voterStatus()
{
var status;
status=document.voterInfo.selInfo.value;

<!-- Mistake: yes=="1", Corrected: status=="1" -->
if (status=="1")
{
alert("Great