How can I remove a value from array in java script? : <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;code&gt;
&lt;!DOCTYPE html&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;Java Script Array methods&lt;/title&gt;
		&lt;script type="text/javascript"&gt;
		
		var ArrStr = ["Yallappa","Rajesh","Kiran"];
		function LoadArr(){
			document.getElementById("Arr").innerHTML = ArrStr;
		}
		
		function But1Click(){
			
			ArrStr.push(document.getElementById("TxtBox").value);
			document.getElementById("Arr").innerHTML = ArrStr;
		}
		
		function But2Click(){
			var Indx = ArrStr.indexOf(document.getElementById("Arr").value);
			alert(Indx);
			if(indx &gt; -1){
				arrstr.splice(document.getelementbyid("arr").value,1);
			}
			document.getelementbyid("arr").innerhtml = arrstr;
		}
		
		&lt;/script&gt;
	&lt;/head&gt;
	&lt;body onLoad="LoadArr()"&gt;
		&lt;h2 id="Arr"&gt;&lt;/h2&gt;&lt;br&gt;
		&lt;input type="text" id="TxtBox"/&gt;&lt;br&gt;
		&lt;input type="button" onclick="But1Click()" text="Push into Array" value="Push into Array"/&gt;&lt;br&gt;
		&lt;input type="button" onclick="But2Click()" text="Remove from Array" value="Remove From Array"/&gt;
		
	&lt;/body&gt;
&lt;/html&gt;
&lt;/code&gt;</code></pre>
</div>
</div>

I wanted to add and remove text from the textbox based on the button click events. And display the array of strings in h2 tag.
    In this I am able to add a new string in array, but I am not able to remove string.
Why please explain me?</p>
