답변 2개 / 댓글 1개
채택된 답변
+20 포인트
Copy
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<script src="https://code.jquery.com/jquery-2.2.1.js"></script>
</head>
<body>
<script>
function check_date(now,j){
if(j=='1'){
$("#select").html("<option>옵션1</option><option>옵션2</option>");
}else{
$("#select").html("<option>옵션1</option><option>옵션2</option><option>옵션3</option>");
}
}
</script>
<input type='button' onclick="check_date('now',1)" value=1>
<input type='button' onclick="check_date('now',2)" value=2>
<select id='select'>
</select>
</body>
</html>
처럼 하시면 될것 같습니다.
답변을 작성하려면 로그인이 필요합니다.