jquery - find on page/element widget javascript -


is there widget or function in javascript duplicates functionality of browser "find on page?" want user type in search input, finds each occurrence of value , highlights. includes found # of # next , previous buttons. great if there widget. if not maybe function find multiple occurrences of string?

find on page

you can use window.find search element on page. searching in dom , window parent object.

<form action=""  id="form2"> <div> <input type="text" id="search"> <input type="button" id="submit_form" onclick="checkinput()" value="submit"> </div> </form>  function checkinput() {   var query =document.getelementbyid('search').value;   window.find(query); return true; } 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -