<select name="menu" id="menu"><option value="1">label 1</option><option value="2">label 2</option></select>
<button onclick="'show()'">Click me</button>
<script type="text/javascript"><br />function show(){<br />var theContents = document.getElementById('menu')[document.getElementById('menu').selectedIndex].innerHTML;<br />window.alert(theContents);<br />}<br /></script>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment