<!DOCTYPE html>
<html>
<body>
<p>Enter text into the input field to activate a function.</p>
<div id="myInput" oninput="myFunction()" contenteditable>100</div>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myInput").value;
document.getElementById("demo").innerHTML = "You entered: " + x;
}
</script>
</body>
</html>
Please provide a solution to this issue. Currently, the value of x is showing as "undefined" in the output.