In an X/HTML form, which script block will retrieve an input value and display it back without errors
or warnings?
A.
<script type=”text/javascript”>
function ShowEntry() {
var inp = document.getElementById(“i”);
var s = inp.value;
B.
value = s; }
</script>
<input id=”i” onchange=”ShowEntry()” />
You entered: <span id=”d”></span>
C.
<script type=”text/javascript”>
function ShowEntry() {
document.getElementById(“i”);
var s = i.innerHTML;
document.getElementsByName(“d”).innerHTML = s; }
</script>
<input id=”i” onchange=”ShowEntry()” />
You entered: <span id=”d”></span>
D.
<script type=”text/javascript”>
function ShowEntry() {
var inp = document.getElementById(“i”);
var s = inp.value;
document.getElementsbyName(“d”).innerHTML = s; }
</script>
<input id=”inp” onchange=”ShowEntry()” />
You entered: <span id=”d”></span>
E.
<script type=”text/javascript”>
function ShowEntry() {
var inp = document.getElementById(“i”);
var s = inp.value;
document.getElementById(“d”).innerHTML = s; }
</script>
<input id=”i” onchange=”ShowEntry()” />
You entered: <span id=”d”></span>
Explanation: