<div class="col-xs-12 nopadding return_fly26">
<div class="col-xs-4 noleftpadding ">
<div class="col-xs-6 norightpadding movies">
<img src="d.gif" alt="App Logo">
</div>
<div class="col-xs-6 flightinformation">
<p class="ddd">ssss</p>
</div>
</div>
<div class="col-xs-5 noleftpadding">
<p class="timings">ssss</p>
<p class="stops">01 h : 30 m</p>
</div>
</div>
<div class="col-xs-12 nopadding return_fly26">
<div class="col-xs-4 noleftpadding ">
<div class="col-xs-6 norightpadding movies">
<img src="d.gif" alt="App Logo">
</div>
<div class="col-xs-6 flightinformation">
<p class="ddd">ssss</p>
</div>
</div>
<div class="col-xs-5 noleftpadding">
<p class="timings">ssss</p>
<p class="stops">01 h : 30 m</p>
</div>
</div>
以下是我试过的方式
$(".onward_fly").html("");
var owner = $('.return_fly'+flight_id).html();
console.log(owner);
如果我控制它,我会得到一个匹配 .return_fly26 的div。任何人都可以建议这个!!!!!!
使用jquery预期输出应与上述相同。
O / P:
<div class="col-xs-12 nopadding return_fly26">
<div class="col-xs-4 noleftpadding ">
<div class="col-xs-6 norightpadding movies">
<img src="d.gif" alt="App Logo">
</div>
<div class="col-xs-6 flightinformation">
<p class="ddd">ssss</p>
</div>
</div>
<div class="col-xs-5 noleftpadding">
<p class="timings">ssss</p>
<p class="stops">01 h : 30 m</p>
</div>
</div>
<div class="col-xs-12 nopadding return_fly26">
<div class="col-xs-4 noleftpadding ">
<div class="col-xs-6 norightpadding movies">
<img src="d.gif" alt="App Logo">
</div>
<div class="col-xs-6 flightinformation">
<p class="ddd">ssss</p>
</div>
</div>
<div class="col-xs-5 noleftpadding">
<p class="timings">ssss</p>
<p class="stops">01 h : 30 m</p>
</div>
</div>
答案 0 :(得分:2)
阅读jQuery selectors API。正确的代码是:
// gets collection
var myDivs = $('div.return_fly26');