html - Jquery .find an id of an id -


i struggling below work. can 2 ids using :has not three. want able apply css span_element when has grandchild of disabling_div.

jquery

$("[id^=span_element]:has[id^=another_id]:has([id^=disablingdiv])").css({ "cursor": "not-allowed" }); 

or

$("[id^=span_element].find([id^=disablingdiv])").css({ "cursor": "not-allowed" }); 

html

<div id="span_element_1"> <!--apply style this, when disablingdiv_1 below-->     <div id="another_id">         <div id="disablingdiv_1">               content          </div>     </div> </div> 

after reading edit , of comments think search this:

$("[id^=disablingdiv]").parent().css(); // that's #another_id $("[id^=disablingdiv]").parent().parent().css(); // that's #span_element_1 

that way go bottom > top , don't have verify if #span_element or another_div contains disablingdiv.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -