<!doctype html><html><head><meta charset="UTF-8"><title>Document</title><style> *{ margin: 0; padding: 0; } #wrapper{ width: 250px; margin: 75px auto; } #wornContent{ width: 240px; height: auto; background-color: #ccc; border: 1px solid #888; padding: 5px; display: none; }</style></head><body><div id="wrapper"> <input type="checkbox" title="" id="worn"> <div id="wornContent">为了你信息的安全,请在公共场所或网吧不要用此功能</div></div><script> function showHide(attr) { var oWornContent = document.getElementById('wornContent'); oWornContent.style.display =attr; } var oWorn = document.getElementById('worn'); oWorn.onmouseover = showHide('block'); oWorn.onmouseout = showHide('none');</script></body></html>
1 回答
繁星点点滴滴
TA贡献1803条经验 获得超3个赞
oWorn.onmouseover = function(){showHide('block')};
oWorn.onmouseout = function(){showHide('none');}
添加回答
举报
0/150
提交
取消