再一次提醒我,我有这个脚本,所以当单击另一个html页面上的按钮“quadrant\u 1”时,它会更改第一个html页面上的按钮颜色,但是
我希望此操作禁用a href链接
,为此,我有:
var noLink = $('a')
if(localStorage.getItem('quadrant_1', ) === 'clicked'){
$("#btn-institucional").css({backgroundColor: "#d8d8d6"});
$("#btn-institucional").unwrap({noLink});
}
移除标记,但问题是移除标记时,会破坏所有行和按钮样式
before tag is removed
After Tag was removed
这是html的一个按钮
<div class="number button col-lg-3 col-md-3 col-sm-12 col-xs-12" style="color:#ffffff; background-color:#003E8B; cursor: pointer; color: #ffffff;" id="btn-institucional">
<a href="gobierno.html" >
<p>1</p>
<img src="icons/institucional.png" width= "50%">
<p>Desarrollo Institucional para un Buen Gobierno</p>
</a></div>
非常感谢您的帮助,我真的不知道为什么会发生这种情况,如果我将div与列的bootstrap类放在一起。