Getting the height of an option element with javascript?

后端 未结 4 868
梦谈多话
梦谈多话 2020-12-12 07:55

As usual, option elements are shown when a select element is clicked and I\'d like to get the height of the option elements.

Thanks.

Edit @d

4条回答
  •  天涯浪人
    2020-12-12 08:19

    On select you can do that:

    $(document).ready(function() {
    
        $('#select').click(function() {
            var H = $(this).children().height();
            alert(H);
        });
    
    });
    

提交回复
热议问题