function contact_open() {
$("#body_flex_wrapper_id").removeAttr('onmouseover')
}
function contact_close() {
$("#body_flex_wrapper_id").attr('onmouseover');
}
答案 0 :(得分:1)
您可以使用attr
和removeAttr
$(function(){
$("#btnToggle").click(function(){
if ($("#div1").attr("onmouseover")){
$("#div1").removeAttr("onmouseover");
}
else{
$("#div1").attr("onmouseover", "overx();");
}
})
})
function overx(e){
console.log($("#div1").text());
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<button id="btnToggle">Toggle</button>
<div id="div1" onmouseover="overx();">
<span>sample div</span>
</div>
&#13;
答案 1 :(得分:0)
试试这个:
+