JQuery 36

211001_div,check,radio

DOCTYPE html> Insert title here div { border: 1px solid gray; padding: 20px 20px 20px 20px; width: 500px; margin-bottom: 10px; } 폼태그연습 #1 아이디 비밀번호 //input에 포커스가 갈 경우 배경색 $("input:text,input:password").focus(function() { $(this).css("background-color", "yellow"); }); //포커스가 벗어날 경우 다시 원래대로(흰색) $("input:text,input:password").blur(function() { $(this).css("background-color", "white"); }) 폼태그연습 #2 운전..

JQuery 2021.10.01

211001_clone,append

DOCTYPE html> Insert title here 1번 영역을 복사해서 3번 영역에 추가 2번 영역을 복사해서 4번 영역에 추가 3,4번 영역 지우기 1번 박스 2번 박스 3번 박스 4번 박스 $("#btn1").click(function() { //box1 아래의 모든 img태그 복사 var no1=$("#box1").find("img").clone(); //3번 영역에 추가 $("#box3").append(no1); }); $("#btn2").click(function() { //box1 아래의 모든 img태그 복사 var no2=$("#box2").find("img").clone(); //3번 영역에 추가 $("#box4").append(no2); }); //3번..remove $("#btn..

JQuery 2021.10.01

211001_list,select,contains

DOCTYPE html> Insert title here 오늘의 쇼핑 리스트 운동화 레깅스 양말 져지 안심스테이크 오늘의 메뉴 선택 초밥 스테이크 떡볶이 김치찌개 //ol 아래에 있는 모든 li 중 첫번째 li //$("ol li:first").css("background-color", "yellow"); //각 ol의 첫번째 li만 선택..child $("ol li:first-child").css("background-color", "yellow"); //전체항목에서 '스테이크'를 찾아서 글자크기 1.5배..contains $("li:contains(스테이크)").css("font-size", "1.5em"); //li의 홀수의 css변경..odd홀수, even짝수 $("li:odd").css("bor..

JQuery 2021.10.01