assignment4

1
Assignment 4 Deadline: May 17 (i) For the following html program, draw the DOM tree. (ii) Write the JavaScript code to display information about all child nodes of <form> tag. The information that your code should display is A. Node type B. Node value C. Node name <html> <head> <script language="JavaScript"> function getInformation(){ //write code here } </script> </head> <body> <form name=myForm method="get" action="check.jsp"> <!-- form elements--> User Name <input type="text" name="uname"> <br> Password <input type="password" name="pwd"> <br> <input type="button" value="GetInformation" onClick="getInformation()"> </form> </body> </html>

Upload: h-k

Post on 15-Dec-2014

228 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Assignment4

Assignment 4

Deadline: May 17

(i) For the following html program, draw the DOM tree.

(ii) Write the JavaScript code to display information about all child nodes of <form> tag. The information

that your code should display is

A. Node type

B. Node value

C. Node name

<html>

<head>

<script language="JavaScript">

function getInformation(){

//write code here

}

</script>

</head>

<body>

<form name=myForm method="get" action="check.jsp">

<!-- form elements-->

User Name <input type="text" name="uname"> <br>

Password <input type="password" name="pwd"> <br>

<input type="button" value="GetInformation" onClick="getInformation()">

</form>

</body>

</html>