본문 바로가기

javascript/jQuery

jQuery after if문

		if(type == '2') {
			let selectOption = '';
			 selectOption += '<select>';
			selectOption +=	`<option value='7'>옵션 선택1</option>`;
			selectOption +=	`<option value='5'>옵션 선택2</option>`;
			selectOption +=	`<option value='6'>옵션 선택3</option>`;
			selectOption +=	'</select>';
			$("#selectType60").after(selectOption);
		} else {
            
        }
if(type == '2'){
	$('#unxp_knd').css({'display':'inline-block'});
	} else {
	$('#unxp_knd').css({'display':'none'});
}
switch(type){
		case "강아지" : 
			return console.log("강아지");
		case "고양이" : 
			return console.log("고양이");
		default :
			return console.log("호랑이");
		}
728x90
300x250