0
两个click处理函数确定哪些子元素是由父事件处理程序点击
$('#current_options').on('click', 'td', function(){
$('#product_options_list tbody').css('display', 'none');
$('.sub_options tbody').css('display', '');
var my_id = $(this).parent().find('input').val();
$('#product_options_list thead').css('display', '');
$('#product_options_list tbody#'+my_id).css('display', '');
});
$('#current_options').on('click', '.icon-minus-sign', function(e){
e.preventDefault();
var rem_id = $(this).parent().find('input').val();
//remove corresponding option values
$('#product_options_list tbody#'+rem_id).remove();
//either highlight next options values or hide table header if no other values present
$('#product_options_list thead').css('display', 'none');
$(this).parent().parent().remove();
});
HTML
<table id="current_options" class="table">
<tbody>
<tr>
<td>
Size<i class="icon-minus-sign"></i>
</td>
基本上,我想从如果单击处理射击停止对TD的点击处理程序在td里面我点击。