Q:

How can I open a select options on mouse hover

I have a select option that is working nicely on click.
Now, I want that select option will be open when mouse is on hover on that select option.
my html is:
 <select name="select" id="inputselect" class="form-control">
  <?php
    $i=1;
    for($i=1; $i<=10; $i++){ ?>
    <option value="<?=$i?>">option_<?=$i?></option>
    <?php    }
    ?>
  </select>

  // script will be like this
  $('#inputselect').mouseover(function(event){
     // code for open the select option on mouse hober
  });

Thanks in advance

A:

See the below snippet.Let me know in comments if you have any qns.

$('select').hover(function() {

  $(this).attr('size', $('option').length);
}, function() {

  $(this).attr('size', 1);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select>
  <option>first</option>
  <option>second</option>
  <option>third</option>
</select>

