You are using wrong this see this example for THIS Scope
http://jsfiddle.net/kevalbhatt18/r2m2ucgv/2/
The above example is give you difference between two this.
1. which is out of Jquery.
2. which is inside jquery function.
- so as you can see in example first console i.e console.log(this) will return window object.
2 . $(this) which is inside click function will give you different value it is related to your button it will gives you button scope
you can also use
jQuery('option').find('.level-0').css('display', 'none')
if you know the class of option.
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>
Jquery
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()
}
})