Javascript 如何通过获取子div id来禁用HTML的ancher标记
我的代码如下:Javascript 如何通过获取子div id来禁用HTML的ancher标记,javascript,html,anchor,Javascript,Html,Anchor,我的代码如下: <a onmouseup="some operation" class="buttonBarButtonContainer" title=""> <div name="buttonBarButton_Save" id="manualDeductionSaveButtonDisable" class="buttonBarButton"> <table style="height:20px;" cellspacing="0" cellpaddin
<a onmouseup="some operation" class="buttonBarButtonContainer" title="">
<div name="buttonBarButton_Save" id="manualDeductionSaveButtonDisable" class="buttonBarButton">
<table style="height:20px;" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td nowrap="true">
<button class="noTransformButton ico_tb-save"></button>
</td>
</tr>
</tbody>
</table>
</div>
这里我只有div id,我想禁用父锚点标记。我该怎么办?我只能使用javascript,甚至不能使用jquery?按照下面的代码使用parentElement.removeAttribute('onmouseup')。确保将javascript放在页面的底部(我将“某些操作”更改为警报,以便您可以注释掉javascript,以验证它在未注释时禁用锚警报):
试验
document.getElementById(“手动扣减保存按钮禁用”).parentElement.removeAttribute(“onmouseup”);
按照下面的代码使用parentElement.removeAttribute('onmouseup')。确保将javascript放在页面的底部(我将“某些操作”更改为警报,以便您可以注释掉javascript,以验证它在未注释时禁用锚警报):
试验
document.getElementById(“手动扣减保存按钮禁用”).parentElement.removeAttribute(“onmouseup”);
它很好,为我工作。非常感谢。:)这很好,为我工作。非常感谢。:)