<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script language="JavaScript">
<!--
function aa(){
for(var i=0; i < document.getElementById("a").length; i++){
//alert(document.getElementById("a")[i].text);
if("5" == document.getElementById("a")[i].value){
document.getElementById("a")[i]=null;
}
}
document.getElementById("a")[document.getElementById("a").length] = new Option("값","밸류");
}
//-->
</script>
</head>
<body onLoad="aa();">
※ select 박스 55 값 동적으로 변경하는 샘플
<select name="a" id="a">
<option value="1" selected>11
<option value="2">22
<option value="3">33
<option value="4">44
<option value="5">55
</select>
</body>
</html>
'Job > Web' 카테고리의 다른 글
[JavaScript & Java] Encode & Decode encodeURIComponent (0) | 2016.05.04 |
---|---|
HTML 특수문자 사용을 위한 Entity Code (엔티티코드) (0) | 2016.02.02 |
[JavaScript] 숫자만 입력 받기 (0) | 2014.04.25 |
[JavaScript] 자바스크립트 내장 Math 함수 활용법 (0) | 2014.04.25 |
[JavaScript] replaceAll 함수 만들기 (0) | 2014.04.25 |