JSFiddle - React, Tailwind, and code Playground

by akhurshid

HTML

<select id="option_two" multiple>        
    <option value="VOIP">VOIP</option>         
    <option value="BDS">BDS</option>          
    <option value="DMW">DMW</option>          
    <option value="IDTV">IDTV</option>          
    <option value="P3TR">P3TR</option>
</select>

CSS

select option[disabled] {
    display: none;
    visibility: hidden;
}

JavaScript

window.onload = function() {
   var fastInternet = document.getElementById("option_two");
    for ( var i = 0; i < fastInternet.options.length; i++) {
        var value = fastInternet.options[i].value;
        if(value == 'IDTV'){
            //need to hide this
            fastInternet.options[i].setAttribute("disabled", "disabled");
        }
        else if(value == 'P3TR'){
            fastInternet.options[i].setAttribute("disabled", "disabled");
        }
    }
};