javascript 值的组合框不适用于 iPad

Combobox with javascript values not working on iPad

我有这个Javascript

$(function () {
var $select = $(".comboboxValues");
for (i = 1; i <= 99; i++) {
    $select.append($('<option></option>').val(i).html(i))
}
});

在此 HTML 元素上

<td class="imageClass">                                  
     <select class="comboboxValues select"></select>
</td>

用这个CSS

.comboboxValues
{
    font-family:Segoe UI;
    text-align:center;
}
.select
    {
        margin: 0px;
        padding: 0px 5px 0px 5px;
        border: 0px;
        outline: 0px;
        border-bottom : 1px solid #6F8393;
        color: #384046;
        background: transparent;
        -webkit-appearance: none;
        -moz-appearance: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -webkit-padding-start: 10px;
        -moz-padding-start: 10px;
        -webkit-padding-end: 10px;
        -moz-padding-end:10px;
        padding-top: 2px;
        padding-bottom: 2px;
    }

此代码用于在桌面和移动设备 android 上用值填充组合框,但在 iPad 上不起作用。

为什么这在 iPad 上不起作用,我该如何解决?

我找到了解决这个问题的方法,但仍然不知道为什么会这样。我刚刚写了一个不同的 Javascript:

function fillComboboxValues() {
var comboboxCollection = document.getElementsByClassName('comboboxValues_iPad');
for (var j = 0; j < comboboxCollection.length; j++) {
    var select = comboboxCollection[j];
    for (var i = 1; i <= 99; i++) {
        var option = document.createElement('option');
        option.text = option.value = i;
        select.add(option, 0);
    }
  }
}

现在它完美运行了。