which script block will retrieve an input value and display it back without errors or warnings?

In an X/HTML form, which script block will retrieve an input value and display it back without errors
or warnings?

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:



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Joshua

Joshua

“Show Answer” not working on this page

Anon

Anon

Answer E is the only one that works by displaying the text entered and doesn’t error. Tested in Chrome.

Chicco

Chicco

E is the correct answer