<input type="checkbox" name="fruit" value="apple"> Apple <input type="checkbox" name="fruit" value="banana"> Banana <input type="checkbox" name="fruit" value="orange"> Orange<br>
<script>
var checkboxes = document.getElementsByName("fruit");
for (var i=0; i<checkboxes.length; i++) {
checkboxes[i].onclick = function() {
for (var j=0; j<checkboxes.length; j++) {
if (checkboxes[j] != this) {
checkboxes[j].checked = false;
}
}
};
}
</script>
참고로 이 코드와는 상관없지만 IIS를 설치한 후 ASP가 안된다고 하는 경우가 있다.
첫 번째는 IIS설치 후 응용프로그램 ASP를 추가하지 않은 경우이다.
두 번째는 ASP 코드가 포함된 웹페이지를 실행시키면 만나는 에러이다.
an error occurred on the server when processing the url. please contact the system administrator. if you are the system administrator please click here to find out more about this error.
이럴 때는 IIS 관리콘솔 - 왼쪽 창에서 Default Web Site 클릭 - ASP 더블클릭 - ScriptErrorSentToBrowser속성을 Ture로 변경하면 됨.(한글의 경우 아래와 같이 브라우저에 오류 전송을 True로 변경)
'학이시습 > 잡학다식' 카테고리의 다른 글
주소를 위도와 경도로 일괄 변환 (0) | 2023.04.30 |
---|---|
엑셀 - 빈셀 동일값으로 채우기 (0) | 2023.04.28 |
새로 고침 Reload (0) | 2023.04.27 |
컴퓨팅사고 - 스크래치 (0) | 2023.04.26 |
독서, 책읽기 (0) | 2023.04.25 |
댓글