doesn't work in IE, but Mozilla works I tried applying style = "display: none" in (for example

Applied style = "display: none" in <option> doesn't work in IE, but Mozilla works

I tried applying style = "display: none" in (for example <option value="test" id="test" style="display:none;">test</option>), this works fine in Mozilla, but not in IE. Does anyone know what is going on there? Also, anyway, can I apply a style mapping not in <option>??

+3
source share
5 answers

Nothing goes wrong; this is how IE behaves. There is not much style that you can do for individual parameters.

It is probably best to remove the parameter from the select element completely using JavaScript if you do not want it to appear in the list.

+4
source

Internet Explorer (unfortunately) will not hide option elements.

() . .

0

, css. , .

0

" , IE", - IE , !

The fact that not all display styles work for all browsers, you just need to try each of them to find out which one works for your browser, or you should even enable testing that your application’s browser works in your code.

! enter image description here

See below for example: javascript ".display = 'inline" only works for IE 8 and above.

<script type="text/javascript">
function f_ToggleCheck(sender, rowN, obj2) {
    if (sender.checked) {
        sender.value = "checked";
        obj2[rowN].style.display = "inline";
    } else {
        sender.value = "";
        obj2[rowN].style.display = "none";
    }
    alert(obj2[rowN].style.display);
}
</script>

<table>
    <tr>
        <td>
            <input name="R_CheckValue" type="checkbox" onclick="f_ToggleCheck(this, 2, R_DateValue)" value="checked" checked="" />
            <input name="R_DateValue" value="2015-05-30" style="display: inherit" size="7" />
        </td>
    </tr>
</table>
0
source

Source: https://habr.com/ru/post/1796155/


All Articles