Depict with explanation a usable real-world example of DHTML scripting.
<html>
<head>
<title> DHTML In Real World <title>
<script type="text/javascript">
function Opens_Child_Window()
{
var getUsername=document.getElementById("userName").value;
var openChild= window.open("","","height=300,width= 600");
openchild.document.Write(“ Welcome!!!!”+getUsername)
}
</script>
</head>
<body>
<table border="1" boredercolor="blue" cellspacing="3">
<tr>
<td> <b> User Name: </b> </td>
<td> <input type="text" id="userName" property="userName"/> </td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="Click Me!!!" onclick="Opens_Child_Window()"/>
</td>
</tr>
</table>
</body>
</html>
In the above designed DHTML we have a textbox to take the user name and on clicking the button a function of name Opens_Child_Window( ) is called which greets user in new window with his name. The new window is opened with the help of window.open property of Window.