Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JQuery:如何选择div的第五个父元素?_Jquery_Select_Element_Parent - Fatal编程技术网

JQuery:如何选择div的第五个父元素?

JQuery:如何选择div的第五个父元素?,jquery,select,element,parent,Jquery,Select,Element,Parent,我想在div中加载类。德国排名项目。我用.DE将div作为目标,然后尝试获取该div的第五个父级 var ger = $('<div />').load( "proxy.php?url=http://www.netindex.com/download/allcountries/&mode=native&callback=complete .top-20-countries .DE"); var ger=$('').load(“proxy.php?url=http:/

我想在div中加载类。德国排名项目。我用.DE将div作为目标,然后尝试获取该div的第五个父级

var ger = $('<div />').load( "proxy.php?url=http://www.netindex.com/download/allcountries/&mode=native&callback=complete .top-20-countries .DE");
var ger=$('').load(“proxy.php?url=http://www.netindex.com/download/allcountries/&mode=native&callback=complete .top-20-countries.DE”);

已尝试:parent、.parent()、.closest()全部无效。

HTML如下所示:

<ol class="ranking">
    <li class="ranking-item">
  <a class="ranking-link" href="/download/2,91/Hong-Kong/">
    <div class="figure">
      <b class="figure-content">84.01</b>
      <span class="figure-unit">Mbps </span>
    </div>
    <div class="ranking-content">
      <div class="ranking-heading">
        <i class="flag HK"></i>Hong Kong
      </div>
      <div class="ranking-chart country-list"><svg width="280" height="20">...</svg></div>
    </div>
  </a>
</li>
...
</ol>

如果你能分享这个标记就太好了。这个链接提供了一个404页面。需要一个尾随斜杠,抱歉。修正。终于有人理解了这个问题;)
var ger = $('<div />').load( "proxy.php?url=http://www.netindex.com/download/allcountries/&mode=native&callback=complete .ranking:has(.DE)");