Stumped with selectors
Posted: Mon Mar 26, 2012 12:48 pm
I want to keep the img hidden until an option is selected. Seems simple enough.
It is hidden on the load, but I can't get it to open on the select.
<script type="text/javascript">
$(document).ready(function() {
$("#pic").hide()
});
$("#dropdown.option :selected")(function() {
$("#pic").show()
});
</script>
...
echo '<td><select id="dropdown" onselect="setit(this.options[this.selectedIndex].value)">';
...
echo '<img src="arrow_down.gif" id="pic" width="32" height="30" border="0" onClick="popit()">';
It is hidden on the load, but I can't get it to open on the select.
<script type="text/javascript">
$(document).ready(function() {
$("#pic").hide()
});
$("#dropdown.option :selected")(function() {
$("#pic").show()
});
</script>
...
echo '<td><select id="dropdown" onselect="setit(this.options[this.selectedIndex].value)">';
...
echo '<img src="arrow_down.gif" id="pic" width="32" height="30" border="0" onClick="popit()">';