<title>Test Live: Javascript Delete Array Element by Index</title>
var myArr= [9, 13, 21, 7, 3, 17];
myArr.splice(myIndexPos, 1);
document.getElementById("myNewArray").innerHTML = "<strong>The new array is: </strong>"+myArr;
<h1>Javascript Delete Array Element by Index</h1>
<p>The index position of the element starts from 0. The specified index position is 2. So, it deleted the 3rd array element.</p>
<strong>Current Array:</strong> [9, 13, 21, 7, 3, 17] <br><br>
<button onclick="RemArrItem()">Delete Item</button> (Click to delete array element by index 2)<br>