Hide all select elements in a div using jquery?

How to hide all 'select' html elements in a specific div using jquery?

thank

+3
source share
1 answer

If the div has the class "yourClass", you can use:

$('div.yourClass').find('select').hide();

If you define a div by id, then it is better to use only id in the selector:

$('#divId').find('select').hide();

You can also save one function call using the " descendant of the descendant " selector:

$('#divId select').hide();
+12
source

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


All Articles