페이지 내에서 ctrl+f > 자료실

자료실

페이지 내에서 ctrl+f

페이지 정보

profile_image
작성자 최고관리자
댓글 0 조회 1,389회 작성일 23-04-28 12:25
작성일 23-04-28 12:25

본문

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<meta charset="utf-8">
 
<input type="text" id="str">
 
<input type="button" value="찾기" onclick="findStr()">
 
<div>
 
This feature is non-standard and is not on a standards track.
Do not use it on production sites facing the Web: it will not work for every user.
There may also be large incompatibilities between implementations and the behavior may change in the future.
 
</div>
 
<script type="text/javascript">
 
function findStr() {
 
    var n = 0;
 
    var str = document.getElementById("str").value;
 
    if(navigator.userAgent.indexOf("rv:11") > -1) {
 
        var f, contents = document.body.createTextRange();
 
        for(var i = 0; i <= n && (f = contents.findText(str)) != false; i++) {
 
            contents.moveStart('character');
 
            contents.moveEnd('textedit');
 
        }
 
        if(f) {
 
            contents.moveStart('character', -1);
 
            contents.findText(str);
 
            contents.select();
 
            n++;
 
        }
 
    } else {
 
        window.find(str);
 
    }
 
}
 
</script>


추천 0 비추천 0

  • 회사 : Cginjs
  • 대표 : Cginjs
  • 주소 :
  • 메일 : admin@mysample.com
  • 사업자 등록번호 :
Copyright © Cginjs All rights reserved.
notice