我已经给出了
<ul class="test1" style="height: 175px;">
<li class=" ">
<label class="ui-corner-all" title="" for="ui-multiselect-apps_data_usage_operator_country-option-0">
<input type="checkbox" aria-selected="true" title="" value="All" name="multiselect_apps_data_usage_operator_country" id="ui-multiselect-apps_data_usage_operator_country-option-0"><span>All</span>
</label>
</li>
<li class=" ">
<label class="ui-corner-all" title="" for="ui-multiselect-apps_data_usage_operator_country-option-1">
<input type="checkbox" title="" value="1" name="multiselect_apps_data_usage_operator_country" id="ui-multiselect-apps_data_usage_operator_country-option-1" aria-selected="true"><span>XYZ</span>
</label>
</li>
</ul>
现在我想从li中取出span的值,其中输入aria-selected =&#34; true&#34;通过jquery。请帮帮我。
答案 0 :(得分:0)
您可以使用:
$('li input[aria-selected="true"] + span').text();
<强>段强>
$(function () {
alert($('li input[aria-selected="true"] + span').text());
});
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<ul class="test1" style="height: 175px;">
<li class=" ">
<label class="ui-corner-all" title="" for="ui-multiselect-apps_data_usage_operator_country-option-0">
<input type="checkbox" aria-selected="true" title="" value="All" name="multiselect_apps_data_usage_operator_country" id="ui-multiselect-apps_data_usage_operator_country-option-0"><span>All</span>
</label>
</li>
<li class=" ">
<label class="ui-corner-all" title="" for="ui-multiselect-apps_data_usage_operator_country-option-1">
<input type="checkbox" title="" value="1" name="multiselect_apps_data_usage_operator_country" id="ui-multiselect-apps_data_usage_operator_country-option-1" aria-selected="true"><span>XYZ</span>
</label>
</li>
</ul>
&#13;
答案 1 :(得分:0)
请尝试此
<android.support.v7.widget.RecyclerView
android:id="@+id/drawerList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
/>
答案 2 :(得分:0)