Home » questions » How to add a search box in a web page?

How to add a search box in a web page?

2006-08-18 03:16:06, Category: Programming & Design
I need to add a search box in my web page, to search for different words / phrases in it. I do not want to use an external search engine (like picosearch, for example) but some code to add in the html file to allow me to search... perhaps taking advantage of some functionality of Internet Explorer and/or VBA? I need to search WITHIN the webpage... it's only web page on an intranet that I have... Yes, that would be the best (TO USE THE INTERNET EXPLORER "FIND" FUNCTION... BUT HOW CAN I PUT A WINDOW WITHIN THE PAGE TO SEARCH ON LY IN THAT PAGE?? I guess the answer is related to JAVA SCRIPT or to VBA... Does anyone know which code should I include in the html file to call the built-in Jave Script or VBA search function????

Answers

  1. Mathew K E

    On 2006-08-18 03:30:14


    I suppose you could use Javascript to obtain this functionality. You can access the text that you want to search through the innerText method of its parent object. And then you can use some Javascript string function to search within the text. Hope this answers your question.
  2. tk2

    On 2006-08-18 03:21:46


    It's hard to create it by your own. It may not accurate or venurable to exploit. Why dont you try google search box? You can even earn money from that.
  3. usp8riot

    On 2006-08-18 03:21:09


    Why not use the browser's find or search feature?
  4. Lisa

    On 2006-08-18 03:25:18


    I still haven't figured that out - I use an external engine from Freefind http://www.freefind.com It's free and easy to use. I have it on my web site, which relies quite heavily on search: http://www.breederlocator.com I tried Google search but didn't like it as much as Freefind. Sorry I couldn't be of more help...