How to scroll down to specific option in a select element?
11:40 09 Dec 2019

What I am trying to achieve is when you click on the dropdown menu and all the options are displayed, automatically to scroll down to specific option (which will be determine prior that), but without selecting it.Just for utility, because I might have a list with a lot of options and I need to be able to automatically scroll down to a specific one when the user click the select drop-down menu. Is that possible?

HTML

JS

$(document).ready(function () {
    var select = $('select');
    $('#select').on('click',
        function() {
            select.val("desiredOne")[0].scrollIntoView();
        });
});

The problem here is that the option is being "marked" in the field but it is not actually scrolling down to that option.

 screenshot

javascript jquery html