Hi ...the document.write prints out x.innerHTML instead of printing out the paragraph...what is my issue?
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="idpraccy.css"
</head>
<body>
<p id="myid1">the quick brown fox jumped over the lazy dogs back<p>
<p id="test">this is a test paragraph<p>
<script>
var x=document.getElementById("test");
document.write("x.innerHTML");
</script>
</body>
</html>
01-31-2013, 08:26 PM
rtrethewey
The quotation marks around "x.innerHTML" mean its a string literal, not a variable. Your code should read: