JSFiddle - React, Tailwind, and code Playground

by Keval Bhatt

HTML

<button>option 1</button>
<button>option 2</button>
<select>
    <option class="level-0" value="top-10-villen-de">Top-10-Villen</option>
    <option class="level-1" value="top-1">Top-20</option>
</select>

JavaScript

console.log(this)
$('button').click(function () {

    if ($(this).text() === "option 1") {
        if (jQuery('option').attr('value') == 'top-10-villen-de') {
            console.log('inside')
            console.log(jQuery('option[class="level-0"]'))
            jQuery('option[class="level-0"]').css('display', 'none');
        }

    } else {

        jQuery('option[class="level-0"]').toggle()
    }

})