Created
April 27, 2012 23:51
-
-
Save kf4x/2514376 to your computer and use it in GitHub Desktop.
JavaScript Exam 3 working with arrays. -HTML-
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
name: Javier Chavez | |
email: jchavez589@cnm.edu | |
--> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Javier Chavez - P6</title> | |
<link rel="stylesheet" type="text/css" href="main.css"> | |
<script type="text/javascript" src="ChavezLT3.js"></script> | |
</head> | |
<body> | |
<div id="content"> | |
<div class="hero-unit"> | |
<h1 id="array_statistics_program">Fruit Stand Market Place</h1> | |
<h2>Written By Javier Chavez</h2> | |
</div> | |
<form class="well"> | |
<label for="entered">Enter the fruit you want to buy below (please enter 0 or more)</label> | |
apples <input name="apples" id="apples" value="6"><br> | |
oranges <input name="oranges" id="oranges" value="4"><br> | |
bananas <input name="bananas" id="bananas" value="5"><br> | |
peaches <input name="peaches" id="peaches" value="2"><br> | |
<span class="help-inline"></span><br> | |
<button class="btn" type="button" onclick=" | |
var fruits = new Array(); | |
fruits[0] = document.getElementById('apples').value; | |
fruits[1] = document.getElementById('oranges').value; | |
fruits[2] = document.getElementById('bananas').value; | |
fruits[3] = document.getElementById('peaches').value; | |
document.getElementById('stats').innerHTML = CalculatePrices(fruits); ">Tell me the stats!</button> | |
<!-- send user input to enteredNumbers then call parseArrary with arg --> | |
<button class="btn" id="clear" type="button" onclick=" | |
document.getElementById('apples').value = '6'; | |
document.getElementById('oranges').value = '4'; | |
document.getElementById('peaches').value = '5'; | |
document.getElementById('bananas').value = '2'; | |
document.getElementById('stats').innerHTML = ''">Reset</button> | |
<!-- reset to original numbers and erase the stats --> | |
</form> | |
<div class="row" id="stats"> <!-- stats --> | |
</div> | |
</div><!-- #content --> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment