jquery - add class to element which grandgrandparent has no "display:none" style -


using jquery want add class select element if grandgrandparent hasn't style="display:none" atribute

html this( here don't want add class):

<div style"display:none">   <div>     <div>       <select></select>     </div>   </div> </div> 

and here want add class select element:

<div>   <div>     <div>       <select></select>     </div>   </div> </div> 

is there possibility that?

first add missing equal sign :

style="display:none" 

then can :

$('select').addclass(function() {     return $(this).parents().eq(2).is(':visible') ? 'myclass' : ''; }); 

fiddle


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -