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

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -