Answers for "js find on whole window"

0

js find on whole window

<head>
    <script type="text/javascript">
        function FindNext () {
            var str = document.getElementById ("findInput").value;
            if (str == "") {
                alert ("Please enter some text to search!");
                return;
            }
            
            if (window.find) {        // Firefox, Google Chrome, Safari
                var found = window.find (str);
                if (!found) {
                    alert ("The following text was not found:\n" + str);
                }
            }
            else {
                alert ("Your browser does not support this example!");
            }
        }
    </script>
</head>
<body>
    <div>LaLa, Lala, laLa , lala, lalala, tralala, some other text</div>
    <br />
    <input type="text" id="findInput" value="lala" size="20" />
    <button onclick="FindNext ();">Find Next</button>
</body>
Posted by: Guest on September-10-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language