怎样改变图片边框的颜色? 30
展开全部
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function init(){
var im=document.getElementById("im");
im.style.border="red solid 2px";
}
function changeBoder(){
var im=document.getElementById("im");
var button=document.getElementById("button");
if(button.value=="变绿"){
button.value="变红";
im.style.border="green solid 2px";
}
else{
button.value="变绿";
im.style.border="red solid 2px";
}
}
</script>
</head>
<body onload="init()">
<img src="img/we.gif" width="200" height="200" id="im" style=""/>
<label>
<input name="button" type="button" id="button" value="变绿" onclick="changeBoder()" />
</label>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function init(){
var im=document.getElementById("im");
im.style.border="red solid 2px";
}
function changeBoder(){
var im=document.getElementById("im");
var button=document.getElementById("button");
if(button.value=="变绿"){
button.value="变红";
im.style.border="green solid 2px";
}
else{
button.value="变绿";
im.style.border="red solid 2px";
}
}
</script>
</head>
<body onload="init()">
<img src="img/we.gif" width="200" height="200" id="im" style=""/>
<label>
<input name="button" type="button" id="button" value="变绿" onclick="changeBoder()" />
</label>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询