How to Remove/Find Word in TextBox Through java Script

How to Remove/Find Word in TextBox Through javaScript

 
1. Javascript code
  1. function ButtonDisplay_onclick() {  
  2.     var i;  
  3.     var words = new Array();  
  4.     words[0] = "Rakesh";  
  5.     words[1] = "Rahul";  
  6.     words[2] = "Riyan";  
  7.     var s = document.getElementById("DisplayTxt").value;  
  8.     var s2 = document.getElementById("div_ID ").value;  
  9.     for (i = 0; i < words.length; i++) {  
  10.         if (s.match(words[i]) == words[i]) {  
  11.             document.getElementById("DisplayTxt").focus();  
  12.             document.getElementById("DisplayTxt").value = "";  
  13.         }  
  14.     }  

2. HTML Code
  1. <div id="div_ID">  
  2.      <input id="ButtonDisplay" type="button" value="Click On" onclick="return ButtonDisplay_onclick()" /> <input type="text" id="DisplayTxt" />  
  3. </div>