我正在尝试从单选按钮单击事件中获取列表项的 id。我尝试了很多符号,但似乎卡在了这个障碍上。任何帮助,将不胜感激。
HTML:
<li class="option" id="100400" title=""> <!-- I NEED THE ID OF THIS LIST ITEM -->
<h5 class="ui-widget-header">Option 1</h5>
<font id="" class="repairDetails" alt="Repair Details" style=""></font>
<font style=""></font><br />
<label class="price">£49.99</label>
<a class="ui-icon ui-icon-wrench dialog_but" title="View Product Detail" href="#" style="">View Product Detail</a>
<div id="op1Dialog" class="dialog_content" title="" style="">
<div class="products">
<h1 class="ui-widget-header">Avaliable Bundle Options</h1>
<font>You can customise this option below</font>
<div class="pOptions">
<h2 class="customOHeader"><a href="#">Handle</a></h2>
<div>
<ul>
<button ID="Button1" class="handle-pre">
Add Handle Preferance
</button>
</ul>
</div>
<h2><a href="#">Blade Fittings</a></h2>
<div>
<ul>
<li for="Radio1">
Clear Extratec Scuff Sheet
<input type="radio" id="Radio1" name="" value="" class="bladeCO"/> <!-- CLICK EVENT HAPPENS HERE -->
</li><br />
</ul>
</div>
</div>
</div>
</div>
</li>
jQuery:
$('.bladeCO').click(function(){
var option = $(this).closest('.option').attr('id');
});
非常感谢。