我的HTML代码如下: -
<div id="secone" class="divs row wow bounceInRight animated">
<div class="question" align="center"> {{Questions.QuestionLabel}}</div>
<div class="question_img" ng-hide="Questions.QuestionImage == 'no_image.jpg'" align="center"><img src="http://api.smartlearner.com/Images/Images/QuestionImages/{{Questions.QuestionImage}}" class="img-responsive"></div>
<div class="col-sm-12 clearfix"><br /></div>
<div class="list-group list_top" data-toggle="items">
<ul class="left1 second optionlist" data-value="{{Questions.QuestionID}}" que-id="{{Questions.QuestionID}}">
<li ng-repeat="Options in Questions.Options" id="{{Options.IsCorrectOption}}">
<a class="list-group-item"><i class=""> </i><input type="checkbox" value="{{Options.QuestionOptionID}}" style="display:none"><img ng-show="Options.OptionText == ''" src="http://api.smartlearner.com/Images/Images/AnswerImages/{{Options.OptionImage}}" style="max-width:15%">{{Options.OptionText}}</a>
</li>
</ul>
</div>
<div class="col-sm-12 clearfix"><br /></div>
<div class="ShowExplaination">
<div>
<div class="explation_title">Explanation</div>
<p class="expla_per">{{Questions.QuestionDescription}}</p>
</div>
</div>
<div class="col-sm-12 clearfix"><br /></div>
</div>
我想找到'ShowExplaination'类使用'optionlist'类,里面是pls.help me out ...
答案 0 :(得分:2)
您可以使用$('#secone .ShowExplanation')
来查找该元素。
答案 1 :(得分:0)
我认为这可能会对你有所帮助。我这样做是为了找到使用每个循环显示你的类。你可以消除循环并根据需要使用它。
$('div .optionlist').parent().parent().find('.ShowExplaination').each(function (){
console.log('sf'+$(this).attr('class'));
})