Kizspy | Question: 24
(Choose 1 answer)
Consider the code:
<script>
function myMethod(){
var arr=["apple", "mango", "kiwi","orchid"];
[MISSING CODE]
} </script>
<form>
<input type="text" id="demo">
<input type="button" value="getValue" onclick="myMethod()"></form>
What code is added at [MISSING CODE] to set the text "mango" of the variable arr to the input tag with
id="demo"?
A. document.getElementById("demo").text=arr
B. document.getElementById("demo").value=arr[1]
C. document.getElementById("demo")=arr[1]
D. document.getElementById("demo").value=arr[2]
FUC