Set 76 Practical Question

⭐ Q26 – JavaScript: Name Input + Show Using document.write

Example Code (Read Only):


<!DOCTYPE html>
<html>
<head><title>Display Name</title></head>
<body>

<h3>Enter Your Name:</h3>
<input type="text" id="nm">
<button onclick="show()">Show</button>

<script>
function show(){
    let n = document.getElementById("nm").value;
    document.write("Your Name is: " + n);
}
</script>

</body>
</html>

Write Your HTML / JavaScript Code