第一个问题,我创建一个过滤器表单,然后单击li children(只是子类,没有li parent),然后检查是否已选中复选框。
<form action='https://intrastro.com/location/' method='post' class='searchandfilter' id='search-filter-form-11' autocomplete='off' data-instance-count='1'>
<ul>
<li class="sf-field-taxonomy-region" data-sf-field-name="_sft_region" data-sf-field-type="taxonomy" data-sf-field-input-type="radio">
<ul class="">
<li class="sf-level-0 sf-item-0 sf-option-active" class="sf-input-radio" type="radio" value="" name="_sft_region[]" checked="checked" id="sf-input-bc44f56e7d5565fa72a5f8502685316c">
<label class="sf-label-radio" for="sf-input-bc44f56e7d5565fa72a5f8502685316c">All Regions</label>
</li>
<li class="sf-level-0 sf-item-2" data-sf-count="4" data-sf-depth="0"><input class="sf-input-radio" type="radio" value="mumbai" name="_sft_region[]" id="sf-input-2483c4a7542a7c52782a6c8b307c3497">
<label class="sf-label-radio" for="sf-input-2483c4a7542a7c52782a6c8b307c3497">Mumbai</label>
</li>
<li class="sf-level-0 sf-item-3" data-sf-count="1" data-sf-depth="0"><input class="sf-input-radio" type="radio" value="pune" name="_sft_region[]" id="sf-input-b17ab188cddb5b1c9882ea5af2f5294b">
<label class="sf-label-radio" for="sf-input-b17ab188cddb5b1c9882ea5af2f5294b">Pune</label>
</li>
</ul>
</li>
<li class="sf-field-taxonomy-region" data-sf-field-name="_sft_region" data-sf-field-type="taxonomy" data-sf-field-input-type="select">
<h4>Filter on the basis of your location</h4>
<label>
<select name="_sft_region[]" class="sf-input-select" title="">
<option class="sf-level-0 sf-item-0 sf-option-active" selected="selected" data-sf-count="0" data-sf-depth="0" value="">Select Location</option>
<option class="sf-level-0 sf-item-4" data-sf-count="1" data-sf-depth="0" value="altamont-road">Altamont Road</option>
<option class="sf-level-0 sf-item-5" data-sf-count="2" data-sf-depth="0" value="andheri">Andheri</option>
<option class="sf-level-0 sf-item-6" data-sf-count="1" data-sf-depth="0" value="bandra">Bandra</option>
</select>
</label>
</li>
</ul>
我尝试了此操作,但没有给出警报:
<script>
(function($)
{
$('input[name=_sft_region]:checked', '#search-filter-form-11').click(function()
{
alert("Checked!");
});
})(jQuery);
</script>
第二个问题,如何使用适用于Chrome或Firefox的Web开发工具获取jquery选择器?