在另一个DIV中查找子Div的ID的值 [英] Find value of a children Div ID inside another DIV

查看:257
本文介绍了在另一个DIV中查找子Div的ID的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的CMS HTML页面中有一个DIV列表,我想知道子DIV的ID值.

I have a listing of DIVs in my CMS HTML Page where I want to know the value of the ID of a child DIV.

作为示例,这是HTML:-

As an example, here is the HTML :-

<div class="view" id="views_slideshow_cycle_div_resources-block_3">
  <div class="views-slideshow-cycle">
     <div class="content clearfix">
       <div class="field-item even">
         <div class="jwplayer-video">
            <div id="4ac1a678934a37fd58e86cf0a7d51c79_wrapper">
               <object></object></div>

我需要知道的是class = jwplayer-video的DIV中DIV的ID值,即"4ac1a678934a37fd58e86cf0a7d51c79_wrapper"

What I need to know is the value of ID of DIV inside of DIV with class=jwplayer-video, which is "4ac1a678934a37fd58e86cf0a7d51c79_wrapper"

我试图做的是:-

$("#views_slideshow_cycle_div_resources-block_0").find(".jwplayer-video")

甚至是这个

$("#views_slideshow_cycle_div_resources-block_0").find(".jwplayer-video").attr("id")

不幸的是,这没有帮助.

Unfortunately, it doesn't help.

请帮忙.

谢谢.

推荐答案

$("#views_slideshow_cycle_div_resources-block_3 .jwplayer-video div:first").attr("id");

这篇关于在另一个DIV中查找子Div的ID的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆