Zadanie brzmi:
Using the following HTML write some Javascript/Jquery to do the following:
When values are entered into the edit boxes fill them into the dropdown input as options.
Sort the options in the drop down list into alphabetical order.
Fill the result span with the selected dropdown option once selected.
Kod: Zaznacz cały
<!-- saved from url=(0022)http://internet.e-mail -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<h1>Exercise 3</h1>
<p>Using the following HTML write some Javascript/Jquery to do the following:</p>
<p>
<ul>
<li>When values are entered into the edit boxes fill them into the dropdown input as options.</li>
<li>Sort the options in the drop down list into alphabetical order.</li>
<li>Fill the result span with the selected dropdown option once selected.</li>
</ul>
</p>
<p>
<ol>
<li><input id="text_1" /></li>
<li><input id="text_2" /></li>
<li><input id="text_3" /></li>
<li><input id="text_4" /></li>
<li><input id="text_5" /></li>
<li><input id="text_6" /></li>
<li><input id="text_7" /></li>
<li><input id="text_8" /></li>
<li><input id="text_9" /></li>
<li><input id="text_10" /></li>
<li><input id="text_11" /></li>
<li><input id="text_12" /></li>
<li><input id="text_13" /></li>
<li><input id="text_14" /></li>
<li><input id="text_15" /></li>
<li><input id="text_16" /></li>
<li><input id="text_17" /></li>
<li><input id="text_18" /></li>
<li><input id="text_19" /></li>
<li><input id="text_20" /></li>
</ol>
</p>
<p>
<select>
<option value="1">alphabeticaly fill input options here</option>
</select>
</p>
<p>
Result:<span> Fill selected option here</span>
</p>
</body>
</html>