删除 table TD 内的 Div id
Removing Div id inside table TD
我想删除 table 中的 div。我尝试使用 Jquery 删除,但没有成功。
$(document).ready(function(){
$('c5_r7_c2_graphical').remove();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<table>
<tr id="c5_r7_row" class="grid_row7"><td class="row_label_cell alt_color2 grid_r7 c5_r7" width="40%"><div class="grid_options">
<b>Guidance websites (e.g. Money Advice Service), online forums or online reviews</b></div></td>
<td class="input_cell clickable alt_color2 grid_r7 grid_c1 c5_c1 " width="12%" nowrap=""><input name="c5_r7_c1" value="1" type="checkbox" id="c5_r7_c1" class="HideElement">
<div id="c5_r7_c1_graphical" class="graphical_select checkbox" tabindex="159"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c2 c5_c2 " width="12%" nowrap=""><input name="c5_r7_c2" type="checkbox" id="c5_r7_c2" class="HideElement" value="1">
<div id="c5_r7_c2_graphical" class="graphical_select checkbox" tabindex="162"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c3 c5_c3 " width="12%" nowrap=""><input name="c5_r7_c3" value="1" type="checkbox" id="c5_r7_c3" class="HideElement">
<div id="c5_r7_c3_graphical" class="graphical_select checkbox" tabindex="165"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c4 c5_c4 " width="12%" nowrap=""><input name="c5_r7_c4" value="1" type="checkbox" id="c5_r7_c4" class="HideElement">
<div id="c5_r7_c4_graphical" class="graphical_select checkbox" tabindex="168"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c5 c5_c5 " width="12%" nowrap=""><input name="c5_c5" value="7" type="radio" id="c5_c5_7" class="HideElement">
<div id="c5_c5_7_graphical" class="graphical_select radiobox" tabindex="171"></div></td></tr>
</table>
我想实现的是通过td清空而不是删除,只是想删除td值。
求助!!!
您缺少选择器 - 在本例中为 #
:
$(document).ready(function(){
$('#c5_r7_c2_graphical').remove();
});
确保您已包含 jquery 库文件。
$(document).ready(function(){
$('#c5_r7_c2_graphical').remove();
});
您缺少 #,如果在添加 # 后这不起作用,请确保您已在页面中包含 jquery。
这是工作示例
$(document).ready(function(){
$('#c5_r7_c2_graphical').remove();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tr id="c5_r7_row" class="grid_row7"><td class="row_label_cell alt_color2 grid_r7 c5_r7" width="40%"><div class="grid_options">
<b>Guidance websites (e.g. Money Advice Service), online forums or online reviews</b></div></td>
<td class="input_cell clickable alt_color2 grid_r7 grid_c1 c5_c1 " width="12%" nowrap=""><input name="c5_r7_c1" value="1" type="checkbox" id="c5_r7_c1" class="HideElement">
<div id="c5_r7_c1_graphical" class="graphical_select checkbox" tabindex="159"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c2 c5_c2 " width="12%" nowrap=""><input name="c5_r7_c2" type="checkbox" id="c5_r7_c2" class="HideElement" value="1">
<div id="c5_r7_c2_graphical" class="graphical_select checkbox" tabindex="162">This will be removed</div>
</td><td class="input_cell clickable alt_color2 grid_r7 grid_c3 c5_c3 " width="12%" nowrap=""><input name="c5_r7_c3" value="1" type="checkbox" id="c5_r7_c3" class="HideElement">
<div id="c5_r7_c3_graphical" class="graphical_select checkbox" tabindex="165"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c4 c5_c4 " width="12%" nowrap=""><input name="c5_r7_c4" value="1" type="checkbox" id="c5_r7_c4" class="HideElement">
<div id="c5_r7_c4_graphical" class="graphical_select checkbox" tabindex="168"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c5 c5_c5 " width="12%" nowrap=""><input name="c5_c5" value="7" type="radio" id="c5_c5_7" class="HideElement">
<div id="c5_c5_7_graphical" class="graphical_select radiobox" tabindex="171"></div></td></tr>
</table>
我想删除 table 中的 div。我尝试使用 Jquery 删除,但没有成功。
$(document).ready(function(){
$('c5_r7_c2_graphical').remove();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<table>
<tr id="c5_r7_row" class="grid_row7"><td class="row_label_cell alt_color2 grid_r7 c5_r7" width="40%"><div class="grid_options">
<b>Guidance websites (e.g. Money Advice Service), online forums or online reviews</b></div></td>
<td class="input_cell clickable alt_color2 grid_r7 grid_c1 c5_c1 " width="12%" nowrap=""><input name="c5_r7_c1" value="1" type="checkbox" id="c5_r7_c1" class="HideElement">
<div id="c5_r7_c1_graphical" class="graphical_select checkbox" tabindex="159"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c2 c5_c2 " width="12%" nowrap=""><input name="c5_r7_c2" type="checkbox" id="c5_r7_c2" class="HideElement" value="1">
<div id="c5_r7_c2_graphical" class="graphical_select checkbox" tabindex="162"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c3 c5_c3 " width="12%" nowrap=""><input name="c5_r7_c3" value="1" type="checkbox" id="c5_r7_c3" class="HideElement">
<div id="c5_r7_c3_graphical" class="graphical_select checkbox" tabindex="165"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c4 c5_c4 " width="12%" nowrap=""><input name="c5_r7_c4" value="1" type="checkbox" id="c5_r7_c4" class="HideElement">
<div id="c5_r7_c4_graphical" class="graphical_select checkbox" tabindex="168"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c5 c5_c5 " width="12%" nowrap=""><input name="c5_c5" value="7" type="radio" id="c5_c5_7" class="HideElement">
<div id="c5_c5_7_graphical" class="graphical_select radiobox" tabindex="171"></div></td></tr>
</table>
我想实现的是通过td清空而不是删除,只是想删除td值。
求助!!!
您缺少选择器 - 在本例中为 #
:
$(document).ready(function(){
$('#c5_r7_c2_graphical').remove();
});
确保您已包含 jquery 库文件。
$(document).ready(function(){
$('#c5_r7_c2_graphical').remove();
});
您缺少 #,如果在添加 # 后这不起作用,请确保您已在页面中包含 jquery。
这是工作示例
$(document).ready(function(){
$('#c5_r7_c2_graphical').remove();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tr id="c5_r7_row" class="grid_row7"><td class="row_label_cell alt_color2 grid_r7 c5_r7" width="40%"><div class="grid_options">
<b>Guidance websites (e.g. Money Advice Service), online forums or online reviews</b></div></td>
<td class="input_cell clickable alt_color2 grid_r7 grid_c1 c5_c1 " width="12%" nowrap=""><input name="c5_r7_c1" value="1" type="checkbox" id="c5_r7_c1" class="HideElement">
<div id="c5_r7_c1_graphical" class="graphical_select checkbox" tabindex="159"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c2 c5_c2 " width="12%" nowrap=""><input name="c5_r7_c2" type="checkbox" id="c5_r7_c2" class="HideElement" value="1">
<div id="c5_r7_c2_graphical" class="graphical_select checkbox" tabindex="162">This will be removed</div>
</td><td class="input_cell clickable alt_color2 grid_r7 grid_c3 c5_c3 " width="12%" nowrap=""><input name="c5_r7_c3" value="1" type="checkbox" id="c5_r7_c3" class="HideElement">
<div id="c5_r7_c3_graphical" class="graphical_select checkbox" tabindex="165"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c4 c5_c4 " width="12%" nowrap=""><input name="c5_r7_c4" value="1" type="checkbox" id="c5_r7_c4" class="HideElement">
<div id="c5_r7_c4_graphical" class="graphical_select checkbox" tabindex="168"></div></td><td class="input_cell clickable alt_color2 grid_r7 grid_c5 c5_c5 " width="12%" nowrap=""><input name="c5_c5" value="7" type="radio" id="c5_c5_7" class="HideElement">
<div id="c5_c5_7_graphical" class="graphical_select radiobox" tabindex="171"></div></td></tr>
</table>