메뉴 건너뛰기

?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
 
</head>
<body>
 
    Name:
    <input type="text" name="firstname">
    <br>
    <br> Email:
    <input type="text" name="email">
    <br>
    <br>
    <br>
 
    <p>p Tag</p>
 
    <button id="hideBtn">감추기</button>
    <button id="showBtn">보여주기</button>
    <br>
    <!-- 감췄다가 보여주는 토글 -->
    <button id="toggleBtn">toggle</button>
 
    <script type="text/javascript">
        $(function() {
 
            $("input").focus(function() {
                // focus오면 (key값, value)
                $(this).css("background-color", "#ffff00");
            });
            $("input").blur(function() {
                $(this).css("background-color", "#ffffff");
            });
 
            $("#hideBtn").click(function() {
                $('p').hide(1000);
            });
            $("#showBtn").click(function() {
                $('p').show(3000);
            });
            $("#toggleBtn").click(function() {
                $('p').toggle(2000);
            });
 
            /* 
            p태그 클릭 시 사라짐
            $("p").click(function () {
                $(this).hide();
            }); 
            */
 
            // p태그 더블 클릭하면 사라짐
            $("p").dblclick(function() {
                $(this).hide();
            });
 
        });
    </script>
 
    <br>
    <br>
    <div align="center">
        <div id="test"
            style="background-color: red; width: 50%; height: 100px; text-align: center;">
            여기가 div tag입니다</div>
    </div>
 
    <script type="text/javascript">
        $(function() {
 
            /* 
            $("#test").mouseenter(function() {
                alert("div영역에 들어옴");
            });
            $("#test").mouseleave(function() {
                alert("div영역을 벗어남");
            });
            */
            
            // 영역에 들어오고 나가는 것 한번에
            $("#test").hover(function() {
                alert("hover 동작");
            });
 
            /*
            $("#test").mousedown(function() {
                alert("div 클릭");
            }); 
            $("#test").mouseup(function() {
                alert("div 놓음");
            });
            */
        });
    </script>
 
</body>
</html>



List of Articles
번호 제목 날짜 조회 수
119 [jQuery Plugin] FCKeditor 2.6.5 사용법 2016.09.11 7179
118 zeroclipboard - 클립보드 복사하기(자바스크립트 클립보드 복사하기) 2016.10.06 7181
117 Table을 DIV로 표현하기 (예제) file 2016.11.17 7467
116 selectbox multiple 선택한 값들 submit 해서 받기 2021.03.26 1349
115 SELECTBOX MULTIPLE 검색하기 2021.03.26 564
114 select box 값 변경, 목록 변경 2016.09.21 9065
113 scrolling to top 2016.12.22 6470
112 radio 제어하기 2021.03.25 170
111 Query 기초 (동적 테이블 (데이터 추가 / 삭제), integrateTable(정렬(sort)) file 2019.01.16 2191
110 prepend / append - element 추가 (부모/자식 관계) 2021.03.31 224
109 POST 방식으로 인수를 전달하고 그 결과를 받아오기 2016.09.21 9202
108 popModal jQuery Plugin Examples / 무료 jQuery 팝업 플러그인 file 2019.01.16 1233
107 parent of the iframe element selector 2021.03.31 203
106 Magnific popup conflict with "jquery.nicescroll" file 2018.11.07 1314
105 load() 메소드 2016.09.21 6412
104 JS 타이머 샘플 2019.06.04 738
103 JS 첵박스 샘플 2019.06.04 694
102 JS 날짜 자료 비교 2019.06.04 787
101 jquery를 활용한 입력폼 초기화하기 2017.03.27 8702
100 jQuery를 이용한 스크롤 따라니는 배너를 쉽게 맨들기(scroll follow) file 2019.01.10 1093
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved