The application returns the most famous attractions for spec

The application returns the most famous attractions for specific cities The user provides her/his ID (numeric 6-digit long) and selects the city to visit, the service then responds with a list of available attractions of that chosen city The user interface consists of a form where the user enters his/her ID and a select list of cities. The form is shown in the figure below The ID is a 6-digit number and the cities are New York City, Newark, and Seattle. The first element of the list is \"Please select a city\" Note The user is given the option of selecting just one city to visit

Solution

<!DOCTYPE html>
<html>

<head>
<title>Test Application</title>
<meta charset=\"utf-8\">
<script type=\"text/javascript\">
function render_values() {
var text_value = document.getElementById(\"ID\").value;
var drop_value = document.getElementById(\"drop\").value;
document.getElementById(\"text\").innerHTML = text_value;
       var ar1 = [ \"Empire state Buliding\", \"Statue of liberty\", \"Middision square garden\"];
       var ar2 = [ \"New Jersy Performing art center\", \"Iron Bound\", \"branch brook park\"];
       var ar3 = [ \"Space Needle\", \"Freemont Troll\", \"Seatle Great Wheel\"];
       if(document.getElementById(\"drop\").value==\"NewYork City\"){
       document.getElementById(\"dropvalue\").innerHTML = drop_value+\": \"+ar1;
           }
           else if(document.getElementById(\"drop\").value==\"Newark\"){
       document.getElementById(\"dropvalue\").innerHTML = drop_value+\": \"+ar2;
           }
           if(document.getElementById(\"drop\").value==\"Seattle\"){
document.getElementById(\"dropvalue\").innerHTML = drop_value+\": \"+ar3;
           }
}
</script>
</head>

<body>
<center>
<div>
<label><b>Your ID:</b></label>
<input type=\"text\" id=\"ID\">
<br>
<label><b>Please select the city you would like to visit:</b></label>
<select id=\"drop\">
<option>Please Select a city</option>
<option value=\"NewYork City\">NewYork City</option>
<option value=\"Newark\">Newark</option>
<option value=\"Seattle\">Seattle</option>
</select>
<br>
<br>
<input type=\"button\" name=\"submit\" value=\"submit\" onclick=\"render_values()\">
</div>
<br><br><br>
Hi
<div id=\"text\"></div>
<br>
<div id=\"dropvalue\"></div>
</center>
</body>

</html>

 The application returns the most famous attractions for specific cities The user provides her/his ID (numeric 6-digit long) and selects the city to visit, the

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site