Here is my HTML and I would like to remove the function show() when mouse over.
<div id="myDiv" onmouseover="show()">Mouse over me</div>
I cannot remove the onmouseover event using .off() in JQuery
function show() {
$("#myDiv").off("onmouseover");
}
But I can remove the attribute using removeAttr()
function show() {
$("#myDiv").removeAttr("onmouseover");
}
I am confused that why .off() doesn't work as expected.