<Div> <a href = "#" onclick = "showPricediv ('aaa')" abc = 1> adsfsdf </a> </div>
<Div id = "aaa" style = "display: none "onmouseover =" temshowTag = true "onmouseout =" temshowTag = false "> <pricediv> <table> <tr> <td> dfdfsdf </td> </tr> </ table> </pricediv> </div>
<Div> <a href = "#" onclick = "showPricediv ('div1 ')" abc = 1> adsfsdf </a> </div>
<Div id = "Div1" style = "display: none "onmouseover =" temshowTag = true "onmouseout =" temshowTag = false "> dfdfdf <br/> <pricediv> dfdfdfdf </pricediv> </div>
<Div> <a href = "#" onclick = "showPricediv ('div2')" abc = 1> adsfsdf </a> </div>
<Div id = "Div2" style = "display: none "onmouseover =" temshowTag = true "onmouseout =" temshowTag = false "> <pricediv> dfdfdf <br/> dfdfdfdf </pricediv> </div>
</Body>
<Script>
Var temEventobject = null;
Var temshowTag = false;
Function document. onclick ()
{
If (event. srcElement. abc = null & temshowTag = false)
{
Var temabc = document. getElementsByTagName ("pricediv ");
For (I = 0; I <temabc. length; I ++)
{
Temabc [I]. parentElement. style. display = "none ";
}
}
}
Function showPricediv ()
{
Document. getElementById (a). style. display = "";
TemEventobject = document. getElementById ();
TemshowTag = true;
}
</Script>
This code is used to open a div by clicking a button and clicking the mouse in the blank area of the page to hide this div
Function document. onclick ()
{
}
In this way, you can override the events or methods of a built-in object, but only the document and window are allowed. Similarly, You can override events or methods such as alert.