[原]层应用边框样式
<style type="text/css">
div
{
width:300px;
height:200px;
background-color:Green;
margin-bottom:10px;
}
.cls
{
border:1px solid red;
}
</style>
<script type="text/javascript">
window.onload = function () {
var inputs = document.getElementsByTagName('div');
for (var i = 0; i < inputs.length; i++) {
inputs[i].onmouseover = function () {
for (var j = 0; j < inputs.length; j++) {
inputs[j].className = '';
};
this.className = 'cls';
};
};
};
</script>
<div></div>
<div></div>
<div></div>
<div></div>