0

How can we use custom search to find website links using java-script, I mean depend on links titles, search result will be appeared on page.

Here is the code:

<tr><td class="lpage"><a href="http://www.google.com/" title="Google">Google</a></td></tr>
<tr><td class="lpage"><a href="http://www.yahoo.com/" title="Yahoo">Yahoo</a></td></tr>
<tr><td class="lpage"><a href="http://www.bing.com/" title="Bing">Bing</a></td></tr>
<tr><td class="lpage"><a href="http://www.1.com/" title="1">1</a></td></tr>
//and more links  

For exp: If someone search Yahoo in custom search, then cause title of Yahoo is exist, yahoo link with it's title name will be appeared in search result. Actually I'm gonna use this for sitemap.

Is it possible to use java-script for this custom search in html?

Thanks in advance ....

Blacklight
  • 3,809
  • 2
  • 33
  • 39
Amin
  • 414
  • 1
  • 11
  • 23

1 Answers1

0

Use an HTML parser such as htmlparser to extract all href elements

Nir Alfasi
  • 53,191
  • 11
  • 86
  • 129
  • I downloaded node-htmlparser-master file, but there is no custom search template that I'll understand how i can use it.. Is it possible for you to give me a example... Include of that htmlparser file are just js file, actually i donnu how to use it... – Amin Sep 22 '13 at 18:40
  • @Amin the link that I posted contains code examples, just scroll down ;) – Nir Alfasi Sep 22 '13 at 18:50