Mouseover option to choose for IE

I am using IE7. I want to show a description on the page for each option in the selection box when the mouse is over an option. Thus, starting from the beginning, I wrote code that shows the value of a parameter in a text field when the mouse is over an option. But it never works. It works as a change event.

<input name="selectedValue" id="selectedValue" >
<select id="TestCombo" name="TestCombo" >
     <option value="0" selected="selected">Zero</option>    
 <option value="1">One</option>
 <option value="2">Two</option>
 <option value="3">Three</option>
</select>

<script type="text/javascript">
$( function() {
    $('#TestCombo option').mouseover( function() {
          $('#selectedValue').val($('#TestCombo option:selected').val());
    });
});
</script>

Thanks in advance

+5
source share
3 answers

If you want the description to be displayed on the mouseover , and not on the change , I think it's better to use tooltips. This can be done using the HTML attribute title, no JS required.

Example:

<input name="selectedValue" id="selectedValue">
<select id="TestCombo" name="TestCombo" >
  <option title="Nothing." value="0" selected="selected">Zero</option>    
  <option title="The smallest number that has a meaning." value="1">One</option>
  <option title="Look, another small number!" value="2">Two</option>
  <option title="RGB - Red-Green-Blue. That three colors!" value="3">Three</option>
</select>
+1
source

, , - . , , , - . , , select , , , "select". , , , , , -.

+1

- ( ), - ul, select.

Unfortunately, IE dropped the ball on the elements selectand did not control them a bit.

+1
source

All Articles