아래의 배경바꾸기 소스는 파폭에서만 작동을 하네요.
오페라에서도 작동을 안하니...
무엇이 문제일까요?
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ko-kr">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<title>zzz</title>
<script>
function zfd(param)
{
var obj=document.getElementsByName("ddd");
for (i=0; i<obj.length; i++)
{
if (param==i)
{
obj[i].checked=true;
}
else
{
obj[i].checked=false;
}
}
}
function aaa(param)
{
var obj=document.getElementsByName("zzf");
for (i=0; i<obj.length; i++)
{
if (param==i)
{
obj[i].style.background='white';
}
else
{
obj[i].style.background='red';
}
}
}
</script>
</head>
<body>
<input name="ddd" type="checkbox" /><a href="#" onclick="zfd(0);">1번</a><br />
<input name="ddd" type="checkbox" /><a href="#" onclick="zfd(1);">2번</a><br />
<input name="ddd" type="checkbox" /><a href="#" onclick="zfd(2);">3번</a><br />
<br />
<div name="zzf"><a href="#" onclick="aaa(0);">1
번</a></div>
<div name="zzf"><a href="#" onclick="aaa(1);">2
번</a></div>
<div name="zzf"><a href="#" onclick="aaa(2);">3
번</a></div>
</body>
</html>