I tried select and write part of arrays. But my code select char of array .
There is my source coce:
<html>
<meta charset="utf-8">
<body>
<table border = "1" >
<tr>
<th>All Arrays</th>
<th>Selected Array</th>
</tr>
<tr>
<td><p id="TotalArray"></p></td>
<td><p id="SelectedId"></p></td>
</tr>
</table>
<table border = "1" >
<tr>
<th>PartOne</th>
<th>PartTwo</th>
</tr>
<tr>
<td><p id="PartOneItem"></p></td>
<td><p id="PartTwoItem"></p></td>
</tr>
</table>
<input type="button" class="button" value="Try" onClick="TryButton();">
<script>
ArrayList = new Array();
ArrayList[1] = "one.one"+"one.two";
ArrayList[2] = "two.one"+"two.two";
ArrayList[3] = "three.one"+"three.two";
ArrayList[4] = "four.one"+"four.two";
document.getElementById("TotalArray").innerHTML = [ ArrayList.length-1];
function TryButton(){
ArrayId = Math.floor(Math.random()*3 + 1)
document.getElementById("PartOneItem").innerHTML = ArrayList[ArrayId][0];
document.getElementById("PartTwoItem").innerHTML = ArrayList[ArrayId][1];
document.getElementById("SelectedId").innerHTML = ArrayId;
}
</script>
</body>
</script>
</body>
</html>