'Use Browser Search (Ctrl+F) through a button in website?
I have created a website and have added a button and lot of text. What I want is to use the browser search (Ctrl+F), when I press the button which I added in website.
How can I achieve this?
Solution 1:[1]
Solution 2:[2]
update: from mark's comment:
From my testing
window.find()
is supported in Chrome 37, and FF31, but not IE11
update:
for more information on this window.find go here
Solution 3:[3]
No. In general, you cannot invoke browser controls from inside the webpage - security, sandboxing, and all that.
You need to make some sort of in-page search - if you're using a CMS, most of them have a simple search feature built-in.
If you want to do this in JavaScript, there are various scripts that emulate this in-page; randomly selected from my query "javascript find in page" is this one: http://www.seabreezecomputers.com/tips/find.htm
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Junaid |
Solution 2 | |
Solution 3 |