I have this markup:
<ul class=container> <li rec=1> <div> <div> <div>i'm here</div> </div> </div> </li> </ul>
I am now on a div element ("I'm here"), how can I get a link to? I tried div.parent("li");but didntwork ..
div.parent("li");
Use
closest("li")
not parent http://docs.jquery.com/Traversing/closest Parent receives only the direct parent.
parentused to produce a unique direct antetsereza element that in your case a div.
parent
div
You must use parentseither closest:
parents
closest
div.parents("li");
Source: https://habr.com/ru/post/1724051/More articles:Theme source code / plugin engine - directoryCan I send a text message from my computer to my cell phone? - smsJava: Why does this method have side effects? - javaHow to set up an external status page in TeamCity, like its standard one, which will not require me to log in? - continuous-integrationpattern matching over a range of values in scala - scalaCreating a subdomain for each user - .netHTML >> Very simple question - htmlIs C # /. NET creation small? - c #Why does Thread.interrupt () act as follows? - javaWhen is it best to use exceptions in PHP? - phpAll Articles