[End.htm]



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>방금 실행한 집합 이전으로 되돌리기</title>

    <style type="text/css">

        .Yellow { background-color:Yellow; }

    </style>

    <script src="../js/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            //[1] JavaScript 텍스트 찾아가기

            alert($('div').find('p').html());

 

            //[2] JavaScript 텍스트로 찾아가기

            var result = $('div').find('p:last').find('b').html();

            alert(result); // jQuery

 

            //[3] 방금 탐색한 기능 이전으로 돌리기

            var html = $('div').find('p:last').find('b').end().html();

            alert(html); // jQuery -> end() -> <b>jQuery</b>

        });

    </script>

</head>

<body>

<div id="myForm">

    <p>

        <b>JavaScript</b>

    </p>

    <p>

        <b>jQuery</b>

    </p>

</div>

</body>

</html>

 



-------------------------------------------------------------------------------------




[실행결과]


--> 첫 화면.
.






--> 위의그림에서 메시지박스의 '확인'버튼을 누른 후의 화면.




--> 바로위의 그림에서 메시지박스의 '확인'버튼을 누른 후의 화면.(위의 [End.htm]소스코드에서 [3] 방금 탐색한 기능 이전으로 돌리기( jQuery -> end() -> <b>jQuery</b> 의 과정으로 아래그림과 같이 출력된 것이다. )




--> 바로위의 그림에서 메시지박스의 '확인'버튼을 누른 후의 화면.(마지막 화면.)












Posted by holland14
: