根据span id是否显示改变input checked状态
#span-64mm 存在时,下面的#filter.p.tag-64mm状态是checked或者背景颜色修改一下
="filter-p-tag-c9a54479-0d2d-4e3c-867a-672d88a4e65c" class="collection__filter-collapsible" aria-hidden="false" style="height: auto; overflow: visible;">
="collection__filter-checkbox-list" role="list">
- ="collection__filter-checkbox">
="checkbox-wrapper">
="checkbox" class="checkbox" id="filter.p.tag-64mm" name="filter.p.tag" value="64mm" onclick="tagopen()">
"false" class="icon icon--check " viewBox="0 0 24 24" role="presentation">
="currentColor" d="M9 20l-7-7 3-3 4 4L19 4l3 3z">
- ="collection__filter-checkbox" style="">
="checkbox-wrapper">
="checkbox" class="checkbox" id="filter.p.tag-70mm" name="filter.p.tag" value="70mm">
"false" class="icon icon--check " viewBox="0 0 24 24" role="presentation">
="currentColor" d="M9 20l-7-7 3-3 4 4L19 4l3 3z">
- ="collection__filter-checkbox" style="">
="checkbox-wrapper">
="checkbox" class="checkbox" id="filter.p.tag-80mm" name="filter.p.tag" value="80mm">
"false" class="icon icon--check " viewBox="0 0 24 24" role="presentation">
="currentColor" d="M9 20l-7-7 3-3 4 4L19 4l3 3z">
- ="collection__filter-checkbox" style="">
="checkbox-wrapper">
="checkbox" class="checkbox" id="filter.p.tag-90mm" name="filter.p.tag" value="90mm">
"false" class="icon icon--check " viewBox="0 0 24 24" role="presentation">
="currentColor" d="M9 20l-7-7 3-3 4 4L19 4l3 3z">
- ="collection__filter-checkbox" style="display:none;">
="checkbox-wrapper">
="checkbox" class="checkbox" id="filter.p.tag-" name="filter.p.tag" value="">
"false" class="icon icon--check " viewBox="0 0 24 24" role="presentation">
="currentColor" d="M9 20l-7-7 3-3 4 4L19 4l3 3z">
- ="collection__filter-checkbox" style="display:none;">
="checkbox-wrapper">
="checkbox" class="checkbox" id="filter.p.tag-" name="filter.p.tag" value="">
"false" class="icon icon--check " viewBox="0 0 24 24" role="presentation">
="currentColor" d="M9 20l-7-7 3-3 4 4L19 4l3 3z">
- ="collection__filter-checkbox" style="display:none;">
="checkbox-wrapper">
="checkbox" class="checkbox" id="filter.p.tag-" name="filter.p.tag" value="">
"false" class="icon icon--check " viewBox="0 0 24 24" role="presentation">
="currentColor" d="M9 20l-7-7 3-3 4 4L19 4l3 3z">
- ="collection__filter-checkbox" style="display:none;">
="checkbox-wrapper">
="checkbox" class="checkbox" id="filter.p.tag-" name="filter.p.tag" value="">
"false" class="icon icon--check " viewBox="0 0 24 24" role="presentation">
="currentColor" d="M9 20l-7-7 3-3 4 4L19 4l3 3z">
- ="collection__filter-checkbox" style="display:none;">
="checkbox-wrapper">
="checkbox" class="checkbox" id="filter.p.tag-" name="filter.p.tag" value="">
"false" class="icon icon--check " viewBox="0 0 24 24" role="presentation">
="currentColor" d="M9 20l-7-7 3-3 4 4L19 4l3 3z">
- ="collection__filter-checkbox" style="display:none;">
="checkbox-wrapper">
="checkbox" class="checkbox" id="filter.p.tag-" name="filter.p.tag" value="">
"false" class="icon icon--check " viewBox="0 0 24 24" role="presentation">
="currentColor" d="M9 20l-7-7 3-3 4 4L19 4l3 3z">
if($('#span-64mm').length)
$('#filter.p.tag-64mm').prop('checked',true)
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!