js find on whole window

Solutions on MaxInterview for js find on whole window by the best coders in the world

showing results for - "js find on whole window"
Ike
30 Nov 2016
1<head>
2    <script type="text/javascript">
3        function FindNext () {
4            var str = document.getElementById ("findInput").value;
5            if (str == "") {
6                alert ("Please enter some text to search!");
7                return;
8            }
9            
10            if (window.find) {        // Firefox, Google Chrome, Safari
11                var found = window.find (str);
12                if (!found) {
13                    alert ("The following text was not found:\n" + str);
14                }
15            }
16            else {
17                alert ("Your browser does not support this example!");
18            }
19        }
20    </script>
21</head>
22<body>
23    <div>LaLa, Lala, laLa , lala, lalala, tralala, some other text</div>
24    <br />
25    <input type="text" id="findInput" value="lala" size="20" />
26    <button onclick="FindNext ();">Find Next</button>
27</body>