我想通过javascript设置1px实心浅蓝色的边框..我写了下面的代码....
function changeImage1(id){
document.getElementById(id).style.border="1px solid lightblue";
}
它不工作....我使用IE来测试这个...帮帮我......
答案 0 :(得分:0)
最好是
<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>