# JavaScript Search engine help

**URL:** <https://forum.kirupa.com/t/javascript-search-engine-help/275048>\
**Category:** web dev\
**Created:** [November 8, 2008, 10:31am UTC](https://forum.kirupa.com/t/javascript-search-engine-help/275048 "2008-11-08T10:31:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lalit\_bisht32](https://avatars.discourse-cdn.com/v4/letter/l/a8b319/32.png) [@lalit\_bisht32](https://forum.kirupa.com/u/lalit_bisht32)\
**Post date:** [November 8, 2008, 10:31am UTC](https://forum.kirupa.com/t/javascript-search-engine-help/275048/1 "2008-11-08T10:31:07Z")

</div>

[COLOR=red] **Search by Word script** [/COLOR]

[COLOR=red] **It gives error but i don’t know whats the problem is there.** [/COLOR]  
[COLOR=red] **Please help me in this script…** [/COLOR]

\<html\>  
\<head\>  
\<title\>java\</title\>  
\<script\>  
aa=new Array();  
aa[0]=“Amit”;  
aa[1]=“Rahul”;  
aa[2]=“Vijay”;  
aa[3]=“Ronak”;  
aa[4]=“Varun”;  
aa[5]=“Akshay”;  
a=0;  
ab=new Array();  
fn=new Array();  
srch=prompt(“Enter char:”,"");  
for(i=0;i\<=aa.length;i++)  
{  
ab=aa\*;  
abc=ab.join("");  
if(abc.charAt(0)==srch)  
{  
fn[a]=aa\*;  
a=a+1;  
}  
}  
document.write(fn);  
\</script\>  
\</head\>  
\<body\>  
\</body\>  
\</html\>
