<div class="bf3l bf3s"> <div class="fleft">some text</div> <div class="tool_click_lbl" data-container-id="trgt_area_container">select</div> <div id="codeid_15txt" class="fleft pad0_10 blue">location</div> <div id="trgt_area_container" class="slider_container"> <div class="slider_closex fright"></div> <div class="slider_title fleft">area</div> <div class="fixer"></div> <ul> <li class="xhn_select">some other text</li> <li class="xhn_select">some other text</li> <li class="xhn_select">some other text</li> </ul> </div> </div>
我點擊:其它文本
我想找到屬性的值:數據容器的id
我試過了(沒成功):
$(this).closest('tool_click_lbl', 'bf3s').attr('data-container-id');
我覺得應該是'$(本)。家長( '.bf3s')...'你在類選擇器上缺少你的'.'。 – War10ck