开发者

how to set border onMouseOver event of javascript

开发者 https://www.devze.com 2023-01-12 04:36 出处:网络
i want to set border of 1px solid lightblue color for athrough javascript.. i hv written d follwng code....

i want to set border of 1px solid lightblue color for a through javascript.. i hv written d follwng code....

function changeImage1(id){
document.getElementById(id开发者_如何学Go).style.border="1px solid lightblue";
}

bt its not working.... i m using IE to test this... help me out....


Better would be

<style type="text/css">
.normal {border: 1px solid black}
.lb { border: 1px solid lightblue }
</style>
<script type="text/javascript">
function toggle(obj,on) {
  obj.className=(on)?'lb':'normal';
}
</script>
<a onmouseover="toggle(this,1)" onmouseout="toggle(this,0)" class="normal">Here</a>
<hr />
<a onmouseover="toggle(document.getElementById('s1'),1)" onmouseout="toggle(document.getElementById('s1'),0)" >Here</a>
<span id="s1">Or here</span>
0

精彩评论

暂无评论...
验证码 换一张
取 消